A UPS backup would probably maintain a computer at sleep with power out no problem. Maybe an option? I get your frustration. From my experience it really requires the MB, video, all other cards and the OS to play very nicely together for it to actually work. I have had very few desktop systems over the years where sleep functions all work the way the should.
In the end....it was VLC PLAYER.
As soon as I use that software the symptoms start to happen and increase more and more. Call it ridiculous but it is true. I stopped using it for some weeks now and it goes well mostly. Still have to reboot every few days because the system starts to get slower in some things, but not even close to the annoying thing of before. Yet kinda sad considering with the AMD Phenom II I never had things like this. So what is VLC Player doing? I have no idea yet. Execute certain code or use certain codecs that bug the Ryzen???
You may be able to go into VLC player settings and disable hardware acceleration and it might help the issue. Worth trying if you would like to still use it.
Glad you figured out the culprit!