My daughter-in-law's phone was exhibiting those same symptoms following a full housing replacement. After much experimentation and swapping parts, I finally narrowed it down to the IR camera on the front camera assembly. With the IR camera disconnected everything else worked as it should (except, of course, Face ID) but when it was plugged in everything else quit working as you described (note that I didn't test the flash at the time).
I couldn't find anything visibly wrong with the IR camera, but eventually ended up giving up on Face ID and just swapped out the front camera assembly with a new replacement so that the other cameras would work again.
Sorry I don't have better news; the IR camera is paired to the motherboard so only Apple can fix it if it's broken. Fortunately they finally started offering front camera replacement as a service so you should theoretically be able to get it fixed if you take it to an Apple authorized repair center.
Cette réponse est-elle utile ?