There is a hidden advanced power setting “Unattended sleep timeout” that can cause this. To make the setting visible:
HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0
Change the Attributes value on the right to 2
Now you will see the “Unattended sleep timeout” setting which, in our case, was set to 2 minutes. We changed it to zero which disables it.