RTL behavior

Hello,

PX4

I use SITL and Gazebo for simulation.

I write a C++ controller that sends MAVLink messages to the Pixhawk.

I load rally points near the home point. In Pixhawk parameters, rtl_type = 1, and rtl_return_alt = 25.0.

The rally points I load have latitude and longitude, and the alt is 100m. For some reason, when I do RTL, the drone climbs to 125m and only then returns to the rally point. Why does it climb to 125m instead of returning to its current altitude (for example, if it flew at 90m)?

Do you have a Log file of that happening? Would help to debug this issue.