If theyre not firing at all that means that the angle is bad and that they cant hit the target within their limited trajectory. This can be a real problem especially for Ballistas because they cant shoot downward and they need a straight line of sight so if you place them on the summit of a hill (sitting horizontaly) and the enemy is coming up the hill the ballistas generally wont be able to hit them.

This can happen with catapults too if the hill is steep enough. Positioning your troops just on the other side of a hill has always been a standard tactic used to protect them from artillery.

This actually just happened to me recently. I attacked a small enemy army with my own that had a few units of catapults/trebuchets in it because i had just come from a seige. The AI (without any missile units of their own to counter) realized i would just sit back and let my artillery use up their ammo before attaking positioned just behind the summit of a large hill in the center whereas normally they would have deployed at the top to gain the height advantage. Due to their perfect placement my artillery couldnt line up a shot on them without getting too close which rendered them useless so i gave the order to assault and crushed them anyway. I have to say that i was impressed and frustrated that the AI pulled that little tactic on me. I was really hoping i could just sit back for a bit and enjoy the explosions and flaming enemies but they denied me that little pleasure so killed them to the last man and slaughtered those who surrendered (by trebuchet firing squad).