My MacBook Air M1 was bought in November 2020 and it's been performing well until this problem began to persist. While I can't recall if I was using airplay the first time this happened, it's possible I was mirroring to an Apple TV as it's something I do daily.
A few days later, after chatting with Apple Support and right before considering taking the device to an Apple Store, I opened the lid and the screen turned on, working again like normal. This lasted an hour at most before going dark again, stuck in a boot loop ending each time with a brief flash of a pink screen then crashing. I also can't remember if airplay was involved this time around.
Realizing the hardware was still functioning, I used another Mac and Configurator 2 to perform a full restore while the MacBook Air was in DFU mode. During the process, the Apple boot screen reappeared and everything seemed to be going well. I started reloading software and using the machine like normal for a good few hours. This time I was definitely mirroring to the Apple TV. All was fine until after a period of inactivity, the device went to sleep. After pressing a key to get it going again, I found the device stuck on the black screen once again.
I've since contacted Apple Support and will be shipping the device for repairs once their packaging arrives.