experiencing the same thing. I rarely use my macbook air m1, but somehow it turned out the way it is now--automatically opening on it's own while lid shut close.
I'll know that it's turned on because I can hear the Apple opening sound even when the lid is close. I tried brining it to the service center even though it's out of warranty and even though I know that I'm using it with utmost care...but I wasn't able to back up files so they told me to back up first.
Not wanting my effort to go to waste, since I was already there, I asked the personnel what will happen if I pursue the appointment with them, what they're planning to do is basic trouble shooting first, which already costs a lot including the check up, then if it doesn't work...there will be a hardware check up (possible another payment).
I know my laptop well, somehow I feel like it's not a hardware issue (reading comments here I was right) cause I've been very careful and I rarely use it. Like so rare. I have this feeling that it might be a software issue. So what I did since they asked to go back after backing up files, I did the basic trouble shooting. Factory resetting the laptop and everything, viola!!! Still automatically opening on it's own while lid shut close.
Somebody help :( If this is a hardware issue (I really hope it's not), oh my gosh that's gonna be expensive.