That's odd. Usually it mainly wouldn't work because of a dirty camera. I would try putting another face ID in and if it still doesn't work then maybe try restarting the phone.
Oh I forgot to add. You can also run diagnostics on your phone so you can test your face ID as well. If there is an issue it will say that action might be recommended. Just a tip you can always use 😄