Chosen Solution

My iphone xs max was lagging and bootlooping, so i disconnected every cable and connected them back one by one. By doing this I discovered that when the front and back cameras are connected, the phone becomes very slow and after about 3-5 min suddenly turns off. I can still take pictures when the cameras are connected. What may be the cause of this, and what can be done to fix it?

See if you can narrow it down to whether its the front or rear camera assemblies. If I’m not mistaken, replacing either of those cameras will result in the loss of FaceID, especially the front cameras. But even if you change just the rear cameras it may cause a loss of FaceID. The only ones capably of reprogramming the new parts is Apple and they won’t do it unless you have them replace the parts which can get expensive.