Did you set your custom GCP app to “In production”?
3. Publish your GCP OAuth2 app
Direct Link: https://console.cloud.google.com/apis/credentials/consent
You might need to set your OAuth application to “Production”, otherwise the credentials expire very frequently.
1. To do this, go to menu item “OAuth consent screen”
or click here https://console.cloud.google.com/apis/credentials/consent
2. Then click the button below if the Publishing status is not “In production”
For more information, see Gmail/Google Drive verification issues (error 400): how to solve