SOLUTION: How do I make macOS Monterey not log off after some time has passed
I'm reviving this by asking a new question because I had the same issue and it was driving me nuts. But I couldn't find anything useful on the forum and the previous question asking this has been locked.
I solved this by going to System Preferences > Security and Privacy > Advanced (find this at the bottom right corner of the window)
Then uncheck the box saying “Log out after XX minutes of inactivity
That solves the problem :-)
MacBook Air (2020 or later)