I don't know how your printer works. Mine is re-flashed with the Marlin firmware.
Have you tried to go through a PID tuning step? I was having a ton of over-heat issues and eventually had to replace both my temp probe as well as the thermal element. After which I did about 6-7 cycles of pid tuning and updated the firmware with the values and now I can complete a 20-ish hour print again without issues. Before it would fail randomly between 1 hour and 10 hours.
I also have my printer plugged into a cheap UPS as a power line conditioner, I found a strange case where if The washer/dryer was running at the same time the bathroom fan kicked in and the printer was in motion it could cause a large enough voltage drop/spike that it would cause the firmware to register a fault and stop the print. Moved the printer to a different circuit and added the cheap UPS and no more problems like that.
I don't even know what a PID tuning step is,,, lol, so, no, haven't done that!! I am on the latest firmware though and tried That is an interesting thing about your power issue. Heck of a catch on the bath fan!!
I don't know if your printer supports directly sending gcode or has a pid tuning function. I use octoprint with my setup and marlin firmware. This explains the process some.