My Mac only sleeps on closing if it’s not plugged in and connected to external monitors. That’s how I would want it to work. How are you wanting it to work? Closing it keeps it on no matter whether it’s plugged in or not?
I want it to stay awake when I close the lid and go with it from my desk to meeting rooms. You can set Linux to basically always ignore the laptop lid close signal, which is what I want.