MacBook Pro m1 freezes when plugged in and out of power

Like the title says,

any time I connect or disconnect my computer from power it freezes up and starts getting really slow and glitchy. Usually all I have to do is restart and it solves the problem. Sometimes the restart is really slow and I get pink screen but otherwise its normal when it turns back on.

I have a lot of tabs so that might be the issue but they are safari and not chrome.

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0

crwdns2942205:01crwdne2942205:0:

What is your RAM size and storage size? Also how much free space does your drive have?

crwdns2934271:0crwdnd2934271:0crwdne2934271:0

crwdns2934285:0crwdne2934285:0