Have you used high quality components: Specifically the USB-C power source and the USB-C cable? For USB-C especially use only Apple components, or those certified as Made for iPhone and spec’d as “USB-C/PD” compatible. Acceptable ones are made by Anker, Griffin, Mophie, and several other well known brands.
The iPhone supports several voltages and currents, and it and the power source negotiate the optimal combination each time you connected them.
If all of your parts are high quality contact Apple Support for hardware assistance→Genius Bar Reservation and Apple Support Options - Apple