I have a family member with a similar iPhone charging issue.
Every other one Apple has fixed for free as some internal solder has failed.
But that was twice in about 50 cases.
(I do free/volunteer tech support for old peoples homes)
An example of the issue I found searching the issue real quick: https://www.thetechmentor.com/posts/fix-lightning-cable-burn...