The EC (embedded controller) controls the hard power off on a modern laptop, not the OS at all. That's why you can still power down in the event of a device lockup (thankfully).
Have had it happen on the Essential Phone and my MIL's Chromebook (don't remember the model). At least with the Chromebook, you can open it with a screwdriver and pull the battery. Better than waiting however many days for the battery to fully die so the EC resets.