Question marked as
Best reply
Get help with Face ID on your iPhone X - Apple Support
If this not help, probably the problem is TrueDepth camera.