There is a bug in random password generator.
Random password generator sometimes generates passwords that do not meet policies and generates this error:
2018-03-06 18:05:59,244  [pool-1-thread-333] ERROR (com.evolveum.midpoint.model.impl.sync.SynchronizationServiceImpl): SYNCHRONIZATION: Error in synchronization on resource:resource-stag-students(STAG-Students) for situation UNMATCHED: PolicyViolationException: Provided password does not satisfy the policies: Required minimal count of unique characters (3) in password are not met (unique characters in password 2)
My configuration in resource schema handling:
The piece code in Password policy: