ThinkPad wakes up from sleep as soon as I close the lid

I have a laptop (a Thinkpad X1 Yoga Gen 3 from 2019) that has this annoying issue where if I send the machine to sleep, and then close the lid, the laptop immediately wakes up again. I’m a bit at a loss how to debug this. I’m running KDE, but the issue is independent of the GUI and happens also when I boot into a command line. This happens regardless of whether I send the laptop to sleep via systemd suspend, via the Fn+4 hotkey, or via the GUI.

I haven’t made any configuration changes to logind, there is no /etc/systemd/logind.conffile and the directory /etc/systemd/logind.conf.d is empty.

The laptop is on the most recent firmware (N25ET65W (1.51) of 17 August 2023). The BIOS is set to use S3 sleep (the option is called “Linux” in the Lenovo BIOS, as opposed to “Windows 10” which refers to S2idle). This seems to be also what the system is doing:

> cat /sys/power/mem_sleep
s2idle [deep]

Googling brought me to the entries in /proc/acpi/wakeup. These are the default after bootup:

> cat /proc/acpi/wakeup | grep enabled
XHC       S3    *enabled   pci:0000:00:14.0
RP01      S4    *enabled   pci:0000:00:1c.0
RP05      S4    *enabled   pci:0000:00:1c.4
SLPB      S3    *enabled   platform:PNP0C0E:00
LID       S4    *enabled   platform:PNP0C0D:00

I’ve tried disabling the lid wakeup via /proc/acpi/wakeup (so that I should only be able to wake the laptop by pushing the sleep [Fn] key):

> su -
# echo XHC > /proc/acpi/wakeup
# echo RP01 > /proc/acpi/wakeup
# echo RP05 > /proc/acpi/wakeup
# echo LID > /proc/acpi/wakeup
# cat /proc/acpi/wakeup | grep enabled
SLPB      S3    *enabled   platform:PNP0C0E:00

But the laptop still wakes up from sleep as soon as I close the lid.

Have I missed something obvious? I’m at a bit of a loss here how to debug this. The issue might be kernel-related (it used to behave normally in the past) or firmware-related, but how do I pinpoint this? How can I dig up debug information from the logs to see what specifically happens when I close the lid?

Capture dmesg output after resume, upload to https://paste.opensuse.org/.

Here is the dmesg output after sending the laptop to sleep with Fn+4 and closing the lid, upon which it resumes :
https://paste.opensuse.org/pastes/c31e4ef067c3

Thanks, there is nothing obvious (actually, nothing at all). Stab in the dark - the PNP0C0E is “Sleep Button”, so you may try disabling it just to see if anything changes.

There is somewhat anectodical post about similar system which suspends only if previously put in s2idle.
Lenovo Yoga instantly wakes up after suspend to ram - Debian User Forums

Stab in the dark - the PNP0C0E is “Sleep Button”, so you may try disabling it just to see if anything changes.

If I do that, how would I resume? That would leave /proc/acpi/wakeup without an enabled way of waking up.