Tbh all my Apple laptops, including the piece of shit one with the emoji keyboard, have had no problem sleeping.
Ofc that's on mac os, not sure what they offer if you install linux or windows.
More than once I went on a train ride to the office, having clicked "Suspend" in the main menu and watching the screen go black before placing the laptop in my bag, just to find out the battery was completely drained and the 2019 MBP so hot that it not just required cooling down before it would power up again but also hot enough to fry an egg - an IR thermometer showed 70 °C!
If anyone knows or writes an application that could place a red warning icon in the menu bar warning me that "suspending" will not actually work, I'll be glad to exchange it for a crate of beer.
mac os is nice enough to allow applications to prevent sleep. Check "pmset -g assertions" to point out the culprit.
A couple years ago it was Chrome for me. It kept an assertion saying "WebRTC has active peer connections" on all the time. This has only lead me to have a pathological hatred for WebRTC and I turn it off in all my browsers now.
As for the dGPU, i've never had one but I do have a feeling that spells trouble, especially with these electron apps and their Helper (GPU) processes. I'm old fashioned enough to do most of my work on desktops that are plugged in and only buy lightweight laptops (13-14 inch mbpros wit no discrete GPU).
But since it's sporadic, I sometimes forget to look into Activity Monitor if I'm in a rush, and for fucks sake this is not a problem that should exist in the first place.
I mean, yes, I've had more issues back when I still used Windows, but my Apple gear costs thousands of dollars, I expect better quality.
I expect that if the system knows that my intent will not be successful (because some application locks suspend) that the option is either not available/greyed out or that I at least get a goddamn prompt "XYZ is locking suspend. <Abort attempt/Force suspend>".
As for Electron, yes, Teams is cursed in that regard (as it is in locking the dGPU), but for me it's usually Parallels, closely followed by IntelliJ that randomly messes up suspend. Neither of them are Electron.
Tbh I don't understand why an OS would allow applications to prevent sleep either, but you mentioned MS Teams and I mentioned Google :)
I don't think IntelliJ ever prevented sleep for me, but I mostly used the Android Studio flavor. I've caught it using up all my ram though if i left it on for weeks.
As for Parallels, I've never tried to close a laptop with a running VM on it. I don't know why, but I always suspend the VMs manually (from the Parallels menu for example) if i use them.