There have been solutions that describe how this may be prevented for Intel Macs utilizing an NVRAM setting, however this AutoBoot setting has no impact on an M1 Mac. There’s a related auto-boot setting within the M1 Mac NVRAM record, which is about to true by default, however setting it to false or %00 will trigger the Mac to be unbootable. I’ve not discovered a method to stop boot when the lid is open on an M1 Mac.