J Leslie Turriff composed on 2024-10-21 23:45 (UTC-0500):
I opened Kate to paste some text. It put up a message about saving existing files or data (the message is gone now of course) and when I declined to save it, the desktop shut down, the system shutdown sequence started, and my machine powered off. I'm not sure what logs might have pertinent information about this.
sudo journalctl -b -1 -e
would be the place to start looking for clues, the tail end of the journal for your previous boot - that is, if you're not using one of those non-systemd distros.