macs are amazing, you can close the lid on a macbook and the computer will be mostly asleep and won't burn down the house; and the best part is it'll work when you open it again. amazing tech.
macOS though, that's getting worse each year.
You do know the reason the Mac goes to sleep when you close the lid is because of the OS right?
I have the exact same lid behavior on my HP laptop running Arch Linux.