I am sure this happens when you limit the rotation axes in your aim constraint.
I can not tell you exactly why this happens but I can tell you how to set it up in a way that it works.
When you limit the rotation axis of your aim constraint, Maya gets confused when your target object´s position is not aligned with the aim vector.
For example, in this case, you want the base to aim at your target only by rotating in Y but your target is in a higher position because it needs to control the cannon orientation too.
To fix that, I assume that your object's local axis to aim is X and the local up Axis is Y.
I create a first target control at the base position, with a 0 value in Y and I will constraint the base, setting up X as the aim vector and Y as the up vector, by limiting the rotation to only Y.
Now your base should follow your control without flipping in the whole 360 range,
as long as you don't move your control up.
Now you create a second control for the cannon that Point constraints the first to only X and Z axes.
So that the base control does not go up.
now you aim constraint the cannon to the new target by using X as the aim vector and Z as the up vector.
(We put Z because the cannon is turning around Z and the up vector needs to be the one the object is rotating around to aim its aim vector)
Now the whole turret should behave as expected.
Hope this helped out
D