Ah this is interesting, I have a ugreen 65w charger that seems to do sometimes this with my pixel 7 pro. It didn't always happen, but I couldn't figure out what would trigger it and how to resolve it again once it started.
I ended up using that charger for other uses in the end and got an Anker one for my phone charging.
USB-C sockets are the bane of my existence lol. My older Nokia (HMD Global) phone the port broke 5 times from cheap connector parts, now in my Sony Xperia 5 ii, it is happening after 2 years and I have had to clean fuzz out of the socket with a toothpick like 5 times lol.