Macbook pro 2021 m1 falls asleep randomly
A couple of days ago my mac was on the charger and was 100% charged, but I didn't turn it off from the charger because I was watching a show, at one point the screen just went out and turned on, as if it had fallen asleep and woke up
After 5 minutes the screen went out completely and the mac stopped responding to the touchpad and keyboard
Rebooting didn't help revive it but I plugged an external mouse into the mac and tried to wake it up, this worked but the keyboard didn't work as before, I realised it was falling asleep and waking up randomly on its own
I had to take it to the service, they removed the cover and disconnected the mouse and keyboard and reconnected it and it worked, but after a few hours it started to fall asleep and wake up randomly again
This is unbearable.
I have the latest version of Mac installed and all the applications on my laptop are up to date and I have no idea what this is about
MacBook Pro (2021)