Hello
It seems like you're experiencing an issue where the machine wakes up automatically from S4/S5 states after being tested with pwrtest and cannot shut down normally. Here are some insights that might help:
PwrTest Sleep Scenario: The PwrTest tool facilitates automated testing of sleep and resume transitions. It can direct the platform into one or more sleep states and log sleep state performance information such as BIOS initialization and total resume times.
Power Management: Some common failures of port-connected devices occur when the system is cycled through various sleep states. A system should always act as if it was started from a completely powered-off state ("cold boot"). Special behavior unique to entering or waking from a sleep state is most likely a bug.
Pwrtest S4 Scenario: Even if the hibernate feature is disabled on a system, pwrtest.exe can still execute the S4 command. This might be related to your issue where the machine wakes up automatically.
OptStandby - Video Memory Purge and Resume: This automated test enables developers, testers, and system integrators to exercise and record power management information from the system. It can be used to automate sleep and resume transitions as well as record processor power management and battery information.