There are several factors that can cause this particular problem ranging from the shutting down of your PC that was not properly done, an outdated Windows drivers, updates that needs to be installed ...
If your Windows computer restarts when it’s locked, this post will help you fix this issue. Usually, this issue can occur due to power settings, software issues ...
You can always use the Shutdown /s /t 60 command and create a desktop shortcut to delay the shutdown of your Windows 11/10 computer by (in this case, 60 secs) or make it shut down at a particular time ...