Why does sparking occur while unplugging a 40V DC, 6A load from a source?
You have solved 'sparking at plug-in' by delaying mosfet 'turn-on'.
Likewise you could avoid 'sparking at plug-out' by first turning off the mosfet and then plugging out the load.
You would need to wire an additional switch to the controller.