How to change plane mission flight altitude after disappears gps_fix


Maybe someone could help me.
I am using raspi as a company computer that detects when the gps signal is lost during a mission flight. In this case, I want to make it so that after detecting the lost gps, plane should descend to about 100 m according to the terrain and the lidar starts working.
All attempted commands through SITL are rejected as not valid and it is not clear how I should proceed. I also change the flight mode to guided from the mission without any problems and it still does not execute such commands as: