This can happen when you enter your website URL in the Authorized redirect URIs rather than your Matomo URL (when setting up Google oAuth config client). This needs to be set to your Matomo URL including the query string for example:

https://matomo.my-website.com/index.php?module=SearchEngineKeywordsPerformance&action=processAuthCode

Refer to the guide on setting up the search keywords import.

Previous FAQ: How do I import Google keywords from multiple protocols/sub-domains into one Matomo website? (using domain property)