Macbook Pro M1 2020 Restarts in Sleep Mode
My current MacOS Ventura version is 13.5.1, no other updates available. My MacBook screen was broken and i got it replaced with original MacBook screen. The laptop was not used for 4 months because of a damaged screen. It was working fine for about a week then I updated macOS version and now I have this issue. It still works fine but if I shut it down and start it again it gets stuck on the login screen. When started in safe mode it starts and continues to work fine but when put in sleep mode it restarts itself.
I ran Apple diagnostics and it gave error ALS001, ambient sensor may have a problem but it seems to work fine. I am not attaching any devices with the MacBook. The report I see after MacBook restarts shows Kernel Panic with core 0 that panicked. I do not understand what is going on.
MacBook Pro 13″, macOS 13.5