Chosen Solution
I replaced both the battery and the lightning port connector and now the phone will not charge. It turned on and showed 1%. I then tried it with another battery and the original charging port. Nothing worked. The origional charging port worked, i just had to move the cable to a certain size.
Do a thorough visual inspection, preferably with magnification, of the area surrounding the battery connector. There are several tiny SMD components just above the connector. Of particular importance is R2201, at the top-left of the connector. If it is missing (which can happen when you pry the connector off), then the battery state does not get communicated to the CPU and this can also cause charging issues and fluctuating readings.
check ur ribbon cables, if not u might have defective part. Where did u get it from? is it oem?