Dysfunctional IRF9540
Does your setup includes a pull up resistor?
Does your setup includes a current limiting resistor to the gate?

Having the gate directly connected to a logic output might have created transients (current and/or voltage) due to the MOSFET's gate capacitance.

Hope it helps.