Chosen Solution
i replaced the housing on an iphone x and now the phone restarts at random
I would suspect something went wrong during the transfer of the flexes and logic board to the new housing. Unfortunately, there are too many variables and not enough info for me to suggest anything more specific. Try going bare bones to see at what point the logic board does not restart. Just the battery and Charge port connected to the logic board should suffice to boot into iTunes. If that is stable, then keep adding flexes until the phone fails (always disconnect the battery first!). If a minimum setup still fails, try a replacement charge port. Otherwise, you have a logic board issue.