On Ubuntu 22.04 on my laptop (Lenovo Yoga 710-14IKB with latest firmware), when I lock the screen, the machine becomes completely unresponsive to any input except to closing and reopening the lid to trigger a sleep-wake cycle.
After the sleep-wake cycle, I find myself at the same login screen as at startup. When I log in, I find that I am in a new desktop session, and that all my running apps have closed.
I also find that if I switch user, I lose the first user's desktop session in the same way.
If I leave the machine running with automatic screen blanking enabled, but automatic screen locking disabled, my desktop session does not get terminated. My previous desktop session was running for at least 2 or 3 weeks until I locked the screen this morning.
This behaviour only started not too many weeks ago. Before that, screen lock behaved normally. However, this may not be the first time that I have had this problem. I previously posted this help request about the machine becoming unresponsive after screen lock. That time round, the problem seemed to resolve itself after I disabled and re-enabled automatic screen lock, but that trick doesn't seem to work anymore.