I have a similar problem. Though my issue of the PC turning back on isn't in software (i have W10).
The problem is in the power button of the case. The one i have is the Lian-Li PC-V700.
You see, the actual button, bellow the plastic round bit, is pretty good.
It feels like a button on a gamepad, but with more depth.
But when the button is pressed down, the entire plastic top is now bellow the outside metal casing.
So if you click it too hard or at an angle, the button will get stuck under the case.
Now the button is always pressed, so i have to open the side panel, take a tiny screwdriver and wiggle the button back out.