It happens to me on Windows 10 if I close the laptop lid to lock the desktop and send it to sleep.
When I open it again, the desktop is accessible for a few seconds (sometimes long enough to launch programs) before the lock screen activates and I have to input my password. The workaround I use is to manually lock with Win+L before closing the lid.