Need improve auto restart function if error occurs.
In additional to software solutions you can use hardware usb-watchdog if the system hungs at all. Aliexpress will help to find it
Also in BIOS settings auto power-on after power loss function should be ON.