Sleep has stopped working, computer shuts down now

I think this has been going on for just over a week (though I’m a little fuzzy on exact dates), but as the title says: my computer shuts down instead of going to sleep.

Via KDE’s settings, I have my computer set to go to sleep after x minutes. And that system was working really well.

However for the past week or so, computer just shuts down.

Can someone help me diagnose the issue? I think its a software issues because I just installed Endeavour OS on another drive in the same machine and that installation too shuts down.

The frustrating thing is that the behavior isn’t predictable (by me at least); there is still a chance (like 20-30%) that the computer will still go to sleep.

So, on the same hardware, except storage, the problem is identical? That doesn’t exclude a hardware issue…

You should look at the system log when the problem happens.

Yes it is on the same hardware.

Dumb question: how can I look at system logs? Won’t they be cleared when the computer powers off instead of goes to sleeP?

See this:
https://discovery.endeavouros.com/forum-log-tool-options/how-to-include-systemlogs-in-your-post/2021/03/

And this:
https://www.freedesktop.org/software/systemd/man/latest/journalctl.html

I’m including the last minutes of activity (otherwise its a massive log).

This is pretty around a minute before I left the computer