Mine did this once for my s20. And the weirdest thing fixed it. I changed how I plugged in the charger. I'm not sure how to describe it. Like I had it plugged into the phone one way but then when I switched/flipped/rotated it, and it started charging regularly. Idk if this is your issue and I apologize that I don't have better writing skills to describe what I did as a fix.