Is it a pid controller or bang-bang. Pid usually undershoots if parameters arent ok. For bed always use bang-bang - pid is no-no for bed.
Edit: and if it shuts "sometimes" and the mosfet is very hot when that happens then its probably in thermal runaway. In thermal protection the gate line would still be high, tho i understand from you when it shuts down its coz the gate is low, and if its low then mosfet may work correctly and the bug may be on the controller side.
Edit: and if it shuts "sometimes" and the mosfet is very hot when that happens then its probably in thermal runaway. In thermal protection the gate line would still be high, tho i understand from you when it shuts down its coz the gate is low, and if its low then mosfet may work correctly and the bug may be on the controller side.