You can usually repair it by simply starting the drone with the card in it so it can finish writing it. As above, it can occur if you don't stop the recording before powering off the drone. Could also happen if you try to take a picture while recording.
I've had a similar thing happen twice. I record some videos, then pop the MicroSD card into a reader, then into my Mac, and copy the files to the Mac. The last video has been corrupted on two occasions. But, similar to what nn666 stated, after then putting the MicroSD card back into the Mini, the next time I took it out and copied the files to my Mac, the previously corrupted file (when re-copied to the Mac) was no longer corrupted.
Obviously, if you've deleted it from the MicroSD card after you first copied it over, then this won't work.
I'm also not sure if I've always recorded additional videos after the corrupted one, or simply the act of putting it back in the Mini allows it to finish writing or something, but in both cases, the file was fine after copying it over a second time.
I can say it's been that way since P3 and continued into M2.
You would think that a graceful shutdown would properly finalize and close the file, even if recording was still engaged. I get that it can't be prevented on an abrupt shutdown though.