You need something like a Mausberry power circuit, that Youtube video is only sending the pie to sleep it's not shutting it down properly / safely like you're wanting. I use the Mausberry and my machine no longer randomly turns on and everything powered by the pie turns off with it. That's why all those videos of people doing the mods with LED buttons have to unplug the machine from the wall to get them to turn off unless they add another switch to turn them off.
Here's the link: https://mausberry-circuits.myshopify.com/products/shutdown-circuit-use-your-own-switch