Change GitLab instance used for authentication

We just tried to do exactly this switch from one Gitlab instance to another. After setting everything up as documented on the new instance, we changed the authentication credentials on MM to the new appId and appSecret.
The result was this error An error has occurred ***Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.***

This locked us out entirely, as no one was able to login to MM with the only allowed method (Gitlab) and we were required to manually revert the changes in the MM config database to connect back to the previous Gitlab instance.

Obviously, there is something else kept around here except for the app credentials that is causing a mismatch and prevents the user from authentication. I have yet to find out what that is.