If a new user is created using an existing user as a template, its extensionAttribute15, which contains information about matching, is copied from the template as well. If the directory synchronization is running, this will result in incorrect object matching.
The workaround is to clean the extensionAttribute15 for the incorrectly matched user.