I was using Win 10 on my 2017 21.5" iMac before, but formatted it and installed Mac Mojave again. Here
format means I've formatted the data disk as well as system disk, merged all partitions and make only one volume. And installed Mojave.
Now if I select "Shutdown" in the Finder menu the Mac always automatically restarts instead. I am using power button to shutdown the computer. Sometimes, the computer restarts itself - without any action. Weird.
How can I fix or diagnose this?