I have had the compass & imu errors cause a crash too. I have two p3a & the first one has been excellent, but the second would occasionally come up with these errors in flight, and then it would switch to atti and opti randomly. Usually, it would sort itself out & fly normally. The last time, however, it suddenly changed to opti & backed into a tree. The bird righted itself at least twice on the way down, but hit a branch & broke the yaw part of the gimbal and removed the camera - the rest of it stayed on board & connected. I replaced the complete gimbal & camera. It refused to start the motors, making loud beeping from the motors. The agent advised that it was in panic mode and had to be left on until it stopped. I left it on for 15 min, but could smell and see the tilt axis servo cook up. It went back to DJI and they are going to replace everything. The log showed all of this happening. I would press them about it.