Among other things, face recognition cannot work in dark environments because there is not enough light for reliable recognition, and starting with ColorOS 7 there is an "Auto brighten screen for Face unlock" feature that can help with this.
- Tap on Settings
- Tap on Password & biometrics
- Tap on Face
- Enable or disable Auto brighten screen for face recognition