Gitlab authentication overwrites existing

We use GitLab as our authentication service. We realized that in some cases Gitlab has overwritten existing user while a new user joins mattermost. Is this a known bug?

What Mattermost version are you on?

We have the version 5.16.0

Would you be open to upgrading to one of our supported versions? We support versions v5.19 and later.