Laptop will not suspend when lid is closed

I have a Dell XPS which has been working great for about 18 months with Fedora

A few weeks ago lid close suspend stopped working.

Im using Plasma and the Button Event Handling settings are set to sleep on lid close. I have not changed any settings.

The setting does not work for either AC power or battery.

screenshot: Imgur: The magic of the Internet

Sleep works ok when triggered manually. The laptop will suspend and wake up as intended. It just for some reason wont work from lid trigger

Could anyone suggest how to fix this?

6.8.9-100.fc38.x86_64

[edit]

Maybe this is relevant

sudo journalctl --unit=systemd-logind --follow
May 29 08:23:18 fedora systemd-logind[977]: The system will suspend now!
May 29 08:23:25 fedora systemd-logind[977]: Operation ‘sleep’ finished.
May 29 08:25:23 fedora systemd-logind[977]: Lid closed.
May 29 08:25:32 fedora systemd-logind[977]: Lid opened.
May 29 08:27:48 fedora systemd-logind[977]: Lid closed.
May 29 08:27:56 fedora systemd-logind[977]: Lid opened.
May 29 08:27:58 fedora systemd-logind[977]: Lid closed.
May 29 08:28:06 fedora systemd-logind[977]: Lid opened.
May 29 08:28:08 fedora systemd-logind[977]: Lid closed.
May 29 08:28:11 fedora systemd-logind[977]: Lid opened.

Added f38, kde

Removed f38, kde

Added f38, kde

You are running F38 which is now EOL.
Maybe someone has useful advice and maybe not, but there will be no further fixes or package upgrades in the future.

I would recommend updating to either f39 or f40 then work with your sleep/suspend issue. It may be the upgrade will solve it automatically or it many not.