It's probably "redirect_uri_mismatch" error. This happens when the redirect URI in your credentials doesn’t match what’s expected in the flow. After you authenticate, Google tries to redirect you, but if the URI doesn’t match, it gives you a 400 error, blocking the process.
Check this here