Automatic Mode Switching by Copter too Quickly

I have been flying my quadcopter indoors using ROS and Hector SLAM. It’s been working fine for the last 100 flights, but yesterday, an anomaly occurred. When the copter started taking off in loiter mode, it drifted and crashed. When I triggered the land mode to avoid the crash, it didn’t get triggered. However, after analyzing the logs, I noticed it had changed its mode too quickly by itself within a span of 200 ms.

Hardware Specs :
Frame type : X-QuadCopter
Firmware : Ardupilot copter v4.4.4
Controller Mode : Joystick
Lidar : LD06

Logs attached :
81 01-01-1980 05-30-00.bin (276 KB)