Someone share this with Apple, they have the same bug.
In my experience Apple devices are the only ones that get sleep right.
I don't know, I had my M1 Air reboot once because I had the wild idea to close the lid while it was charging. Usually only one of the two is happening. But a friend that has been around MacBooks for longer told me they do it. Hence my comment.