Wrong Yaw target in Mission with ROI

I’m having problems with yaw target generation during auto mission.
My quad has a pitch-only gimbal, and all the parameters set so that in auto mission the yaw of the copter is used for the camera.
What I’m getting very often is that the target yaw for the ROI is random. I tested with a simple mission with a waypoint and a ROI.
I attach the log file in which I tested the same identical mission 3 times in the same flight. You can notice that the position went 3 times in the correct spot, while the yaw target is always different (the first two times basically correct and the third completely different and wrong).

I’m really stuck, because this doesn’t work most of the times. The attached log is a lucky one, because usually it doesn’t work 6 times and it works 1 time.

Log: http://www.mediafire.com/file/fkt9pniifvxetbe/2020-02-25_11-24-05.bin

First thing I usually look at is Desired v Actual.
In this case the yaw is good but roll and pitch are way out.

This craft needs an autotune.
Its more of a wonder its not wobbling all over the place.
Through all this your desired versus actual yaw is the best trace of the 3.

Next is how hard your motors are working.

As they are up near the maximum workable, it’s not leaving a lot of headroom for manoeuvring.
This could also be partially due to :
Your battery voltage also sags to 19.5v which is not going to help matters.
With a fresh battery your motor outputs might look a lot better.
That’s not doing your 6S battery any favours. Our minimum (read - be on the ground) is 21v for a 6S.
Your current sensor is also not configured.

Thanks for the analysis.
About the tracking I know roll and pitch are not very good, but the overall behavior seems quite nice so I didn’t tune it more.
About the motors: working at 1650 pwm is ok since it’s nonlinear and they are giving around half the thrust at that pwm, so there is some room for manouvering.
About the 6S: it’s a Li-Ion, and that specific model can go down to 2.5V per cell, so 15V. No damage to the battery ;).

But what about the wrong desired yaw in the mission?