Hi Alan,
Assuming it was all working before the housing swap, we'll rule out the motherboard as the source of the problem to start with. That leaves us with two prime suspects, the lighting port assembly and the battery.
With regard to the battery, it's always possible that it got damaged in the process of removing it and relocating it to the new housing. That isn't my first inclination, though; I'm a little more suspicious of the lightning port flex assembly, myself.
Did your new housing come with that part, or did you pull the old one and install it in the new housing? Either way it's possible it's at fault; I know when I did a housing swap on my grandson's iPhone X, it turned out the charging port assembly had a bad sensor on it and I ended up having to replace it. Contrariwise, if you used the old one, it could be that it got damaged in the process and is now giving you problems.
If it was my phone, I think that's where I'd start, first with double-checking all of the lighting port and battery connections and examining the connectors themselves with a magnifying glass, then cleaning them with 90% or higher isopropyl alcohol and check to see if it made any difference.
If not, I'd probably go ahead and replace the lightning port assembly and if that didn't do it I'd go with a new battery.
These are just my thoughts; take this advice for what you paid for it. Hopefully some of the members here who are actual repair technicians can chime in and add their opinions.
Good luck; let us know how it goes!