The owners of various Macs that use the Apple M1 processor are reporting a bug that involves a rather random activation of the screensaver that also locks out the user. The problem seems to occur on Big Sur macOS 11.x and it looks like disabling Fast User Switching prevents it from happening again.
https://www.notebookcheck.net/Some-Apple-M1-Macs-are-affected-by-a-Fast-User-Switching-bug.515558.0.html