basic electronics question

Great you got it going! Some of what I wrote without seeing complete schematic was wrong. There is no active fault protection that I can see.

The mosfet may blow if upper and lower mosfets turn full on at same time, basically a short on power supply. A transient or instability may cause that. It may be possible to add a 2n2222 transistor where the base would connect to mosfet source, the emitter to -40V (other end of 0.1 Ohm) and collector to mosfet gate. If the current reaches 6.5A the 2n2222 will shut off mosfet. It will actually limit current at 6.5A, but that is well below 20A hot mosfet rating. The 0.1 Ohm is rated at 3W, at 6.5A dissipation would be 4.2W.