There could be several reasons why your Windows PC is automatically locking or hibernating shortly after startup. One possibility is related to power settings, particularly if "Fast Startup" is enabled. When Fast Startup is active, the system may not properly shut down or hibernate, leading to unexpected behavior such as reverting to the lock screen.
Another potential cause could be related to scheduled maintenance tasks that wake the computer, which might inadvertently trigger a lock or hibernation. If your system has scheduled tasks that are set to run shortly after startup, they could be causing the system to lock.
To address this issue, you might want to check your power settings, disable Fast Startup, and review any scheduled tasks that may be affecting your system's behavior.
References: