I was having the exact same issue calling the Google Play Developer API through a Google Cloud Run function service account. I found a GitHub discussion that suggested adding a new product and activating it to speed up the permission propogation. That worked right away for me after hours and hours of trying to fix the 401 errors.
https://github.com/googleapis/google-api-nodejs-client/issues/1382