Yes, that can happen through port damage too for a variety or reasons, but the cost of a Logic Board to fix it when out of warranty (or you did not purchase AppleCare+) doesn't make sense so typically it is recommended to replace the phone. The phone is not waterproof either, so rain or humidity can also be corrosive on the port, and don't necessarily mean you dropped it into the water. If they determined liquid damage it is not repairable at all.
I assume either you or the Apple Store tested with a different cable/charger to rule that out as the cause.