Most Gimbals can’t rotate 360 degrees. As I recall, there are ArduPilot parameters that set the limits of movement on each gimbal axis. In fact The gimbal controller has limits too.
I’m wondering if this is taken into consideration when targeting with the gimbal.
For a copter that has the ability to yaw independently of flight path, it might be better to not rotate gimbal yaw at all - but orient the copter to face the target, and just use the gimbal to adjust pitch to target the desired altitude.
It may take some experimentation to figure this out, I don’t see comments or questions on this subject - it gives me the feeling that it isn’t something many people sort out any more.