This is absolutely caused by the AM charging port. I’ve installed multiple XS/X AM charging ports and after the phone is powered on, it will reboot every 4-4.5 minutes until you pop the original one back in (that is - unless you damaged something along the way).
For charging ports I’ve learned my lesson: always use a premium, OEM part. This is not a part you want to cheap out on. It’s a pretty time-consuming repair already; just spend 4 extra bucks for the Apple (used/refurb/whatever) part.