Hi there,
New user here, so please forgive me if I make a mistake.
I began having this same issue when I would go AFK for about 5 mins, and I came across this discussion.
The fix which worked for myself was to click the battery icon, (I’m on a laptop, so I’m not sure if the same goes for PC) then check “Block” under “Sleep and screen locking after inactivity”.
I found that even with all of the settings in power management set to “Do nothing” the problem persisted, but after making this change from the panel bar, the screen no longer reverts to the login screen after 5 mins of inactivity.
When the problem was occurring, there was a chance that after typing my credentials and hitting enter, nothing would happen. I had to select the “virtual keyboard” button and that would give me the option to switch users, which would take me back to the login screen for KDE plasma and could be confirmed by the background of the login screen matching what I had set (the initial login screen had the default background).
Even then, once I logged back in the screen would be black and the cursor was frozen.
As I mentioned above, blocking the “sleep and screen locking after inactivity” option fixed this issue.
The option for making this change persistent is located in the system settings under “Security and Privacy” and is titled “Screen Locking”. Simply disable this feature by selecting “Never” under the “Lock screen automatically” option. Without making this change in the system settings, the selected option to block it will revert to “automatic”. This will cause the lock screen to activate after 5 minutes.
This setting is independent of power management settings because its purpose is to ensure security of the device.