If you damaged the connector on the main board the phone is ruined. It would need a board level repair with someone with micro soldering experience to remove and replace the connector. If it's just the cable itself, you need to replace the whole component the the cable is attached to. 4013 is a software issue, you should of tried to dfu restore the device before taking it apart..
It’s part of the front facing camera, so you’ll have to replace that entire part. The cable you removed if the FaceID. You can try and do a DFU with it unplugged, then plug it in and go through the setup.
Yeah I think you borked one of the cameras or the flood illuminator. Unplug all three camera connectors and the faceid flex and see if the phone stops bootlooping. Some times iPhones will boot loop if the ambient / prox is damaged.