MacBook Pro shuts down when lid is closed
My 2023 M3 MacBook Pro (Sonoma 14.4.1) recently started shutting when I close the lid instead of going to sleep. If the lid is closed and immediately opened it doesn't, but if it is closed for a few minutes it shuts down completely, and I have to restart it.
It did not shut down unexpectedly at any other moment, only when the lid is closed.
It did not receive any shock recently and no liquid was spilled on it.
I tried to find the cause in the terminal but it seems it didn't even register the shutdowns :
log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h
Filtering the log data using "composedMessage CONTAINS "Previous shutdown cause""
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp Thread Type Activity PID TTL
--------------------------------------------------------------------------------------------------------------------
Log - Default: 0, Info: 0, Debug: 0, Error: 0, Fault: 0
Activity - Create: 0, Transition: 0, Actions: 0
Any idea what the problem might be ? Thanks in advance.
MacBook Pro 14″, macOS 14.4