I have designed a driver circuit for a piece of agriculture equipment that has a high current electromagnetic solenoid. The driver utilizes an ESP8266 MCU and a small app on a smartphone which lets the user set the period and interval of the solenoid (ie. 1 second on, 30 seconds off). The driver is powered from a 12V lead acid battery in a tractor.
The driver works great and has operated trouble free for many hours on end. The problem I am having is when applying power, there is a chance that the IRFZ44Z MOSFET goes short circuit and the solenoid slams open. Replacing the MOSFET repairs the driver. If the MOSFET does not short circuit immediately upon applying power, the driver works trouble free.
After shorting several MOSFETs, I think I have narrowed down the cause to the order of connecting the positive and negative connections. The driver is connected via a heavy duty power connector (see picture). If I kind of "twist" the power connector while plugging it in to "favor" the negative terminal and have it make contact first, it seems the MOSFET does not short. This may be a complete fluke as I cannot see how this should make any difference, as the rest of the circuit is isolated from any grounds on the machine.
Upon drawing out the schematic, I realized that I have connected my flyback diode incorrectly.

Obviously the anode of the diode should be connected to the drain of the MOSFET. However, I do not believe this is causing my MOSFET to short as the driver works perfectly fine indefinitely as long as it survives the initial power-up. The MOSFET is also not being overloaded and does not even get warm after hours of normal operation.
Any ideas what is causing the MOSFET to intermittently short circuit only upon applying power?