@vicmohamed : I agree with your solution to this problem. I too just replaced the charging port to a water damaged iPhone XS with an after market replacement- I had no idea why the XS kept restarting after exactly 3 minutes. I spent a good amount of time researching the problem, and narrowed it down to the phone’s analytic reports showing the thermal system not being communicated with and causing the Kernel Panic. I saw these postings, re-opened the XS, and replaced the charging port with the old OEM (cleaned with 99%ISO) charging port cable. Problem immediately solved. I hope everyone has a similar experience and gets their phone working! Good luck