Yes and Macs have worked like that since the PPC days. Display closed + no external display connected = sleep. Removing said display will also make it sleep.
I guess it's a bug or some monitoring service that crashed.
Any fullscreen apps using the GPU will prevent a MacBook from sleeping when the lid is closed. Games, YouTube, even some GPU-heavy apps can prevent it from sleeping.
Why the frak doesn’t the laptop have an over temp shutdown feature? iPhones so, trying leaving one in the sun for a bit.