Weird Bug When Closing Laptop's Lid

Yesterday I was coding a new project. Eventually, I got tired and decided to work on it today. I shut the lid on my Chromebook and went to bed. This afternoon, I opened the lid again to see this monstrosity:

I was puzzled. Is there any reason why this would happen?

Maybe your cat walked across the keyboard…? I suggest to prevent this maybe save then close the tab, no idea why this happened. Maybe because it was running when you closed the device it glitched and locations got switched.

Maybe its the browsers/computers fault, maybe the tab stoped working to save resources or to minimise computer activity. A lot of stuff happens behind a computer when you shut the lid (well at least for a Mac ); software checks and ect.

Windows does similar so yeah.