Drastic change in pitch and roll angular rate setpoint during flight mode transition

Hello folks,
Changing the flight mode from stabilized->Mission and Mission-> Stabilized causes an abrupt and drastic change in pitch and roll angular rate setpoint. Which causes undesirable oscillations of the vehicle during any flight mode transition.

This happens in real flight as well as in the simulator. Could you help me figure out the cause behind this abrupt change of setpoint values when the mode is changed?

Test environment

  • PX4 v1.10.1
  • X-Plane Simulator

Flight log