This error normally happens if you missed something in the configuration of OAuth2 credentials or refresh token. Could you please confirm if you followed this
guide carefully and which app type have you configured? Also, please make sure that when generating the refresh token, you are using the same login used to create the OAuth2 credentials.