This is usually due to bad aftermarket shorted replacement parts. I get these a lot with rear cameras which I bought too cheap, all of them were faulty defects, dots on rear camera when testing, no focus issue, board shorting from the camera causing rapid fast hot battery drain.
How to solve it?
Get better quality parts from a supplier. For charging ports and front camera assemblies iPhone 6 and up I try to find the ones that have the apple logo printed on it for OEM quality.
I assume you unplug the battery before taking out the screen or any other ribbon cable.
Which is what you should do to avoid short circuiting on the logic board (e.g no backlight issue). (excludes home button for iPhone 5s).