When I was traveling, my iPhone automatically entered the theft protection function. When I logged out, the face recognition kept failing and I couldn't unlock it with a password.
Unable to quit the theft protection function
For help with screen lock, please post in the Apple Support Community. The Apple Developer Forums are for questions about APIs and features intended specifically for developers.