A weird crash, abnormal pitch angle

I’m using AC 4.1.5 on HolyBro’s “Pixhawk 4” and using raspberry pi 4. I control the flight using joystick in QC. I had a weird crash with my drone. While I took off my drone, it lost control immediately. I read the flight log, found that pitch angle decreased while I didn’t affect it. I don’t understand why. One more thing, my drone was flipped upside down but AP didn’t detect the crash and proceeded to turn off the motor.
This is my log:

The crash almost destroyed my Drone. This is the first time I’ve had this happen and I don’t know why. Can someone help me explain this problem?
Thanks you.

First of all, FS_CRASH_CHECK is set to 0 in your config. This is why the motors did not shut down. Please set it to 1.

Second, I see that you have a slightly non-standard RC channel layout: you have throttle on Channel 1 and pitch on Channel 3. However, your channels are set up in such a way that the trim on Channel 3 is set as if it were a throttle channel. For this reason, it seems likely that the Loiter mode interpreted the value of 1484 on Channel 3 as if you want to fly backwards with some speed. Normally, 1484 is within the dead zone around 1500 or so, so it is not interpreted as a wish to fly backwards.

This is somewhat supported by the desired pitch - the attitude your flight controller wants to fly! - of roughly 7 degrees at the moment of leaving the ground, and this value quickly raised to 21 degress within half a second. The copter did not respond quickly enough, so it oscillated in the first second with pitch reaching 50 degrees. Shortly afterwards, the pitches actually aligned, but at the time the copter had already been definitely somewhere out of your reach.

So, the general solution is to perform radio calibration anew - generally, this should be done after each serious change of the RC system. From that you still use EKF2 in the 4.1+ ArduPilot, maybe without recognizing this fact, I assume that you have used this copter for quite a long time, but recently updated your remote control a little.