In my case it was the cable. To be precise pins within metal jack on one side got damaged. If I would plug that side in the phone, whichever port, including cooler, I needed to constantly plug it in and out to get it charging. If I would plug that side of the cable into the charger, I would have the same problem on the charger side. That's how I discovered it was the cable and not the phone.
I bought the new USB-C 3.2 cable rated at 5A. You have to buy 5Ampere (100 W) cable to be sure it will charge fast.
It all happened just last week and the phone is 8 months old. So more or less identical as your case.