I had the same problem. After having my iPhone's XS battery replaced at an authorised service provider, face ID stopped working although they told me that the device's condition was perfect.
The explanation given by Apple support was that this is not because of battery replacement, but from a preexisting hardware problem of the proximity sensor, which became evident after uninstalling and reinstalling the operating system, in order to change the battery.
As they told me, this can happen in any electronic device of any manufacturer, not just iPhones.
+
+
The proposed solution was to replace the proximity sensor, which I didn' t because the cost was extremely high, higher than the iPhone's value, and Apple does not cover it.
I had the same problem. After having my iPhone's XS battery replaced at an authorised service provider, face ID stopped working although they told me that the device's condition was perfect.
The explanation given by Apple support was that this is not because of battery replacement, but from a preexisting hardware problem of the proximity sensor, which became evident after uninstalling and reinstalling the operating system, in order to change the battery.
As they told me, this can happen in any electronic device of any manufacturer, not just iPhones.