If you fly Betaflight on an F4 flight controller (especially the Omnibus F4), and you use Blackbox with an SD card reader on board, I know why your quadcopter sometimes thrashes violently and then crashes. And I can fix it.
The answer is that there's a DMA conflict between the SD card reader and the motor outputs. But you can disable SD card DMA, which resolves the conflict.