Desired altittude becomes suddenly negative

I am fabricating an indoors quadcopter that uses VIO as seen in ROS and VIO tracking camera for non-GPS Navigation — Dev documentation ( And I encountered an issue while flying in LOITER mode (whilst using rtabmap-ros) where it suddenly changed its desired altitude suddenly changed to a negative value, and then my input commands for the throttle channel became 1000 ms.

What was happening is that my drone suddenly started to lower itself until it touched the ground and then went up almost to the ceiling, and then I regained control and landed it safely.

These are the log and BIN files:!AiCZVbf06XX7hO4qBG9zANRwOhV2PA?e=ec9ghG

You post too little information, What versions? What hardware?

Yes sorry. Im using arducopter 4.0.7 on a durandal with a pm06 power module. The companion board is a rpi 4 4gb with ubuntu 18.04 running ros melodic.