SITL starting in auto then it switches to RTL

I am starting the SITL in guided using ROS then I switch it to auto. it starts following the mission waypoints but after some time it’s constantly dropping to RTL. I am not commanding it to switch to RTL. it does it on its own.

what could be causing this?

its flying fine and following the mission wp as it should.

how could I get a log or error output that tells me what is triggering the auto to switch to RTL


You can find SITL log in the logs directory in the directory where you launch SITL. That will be the simpliest way to diagnostic what cause the change to RTL