Have you tried testing this locally in Node to see if the same issue reproduces? It might be that your PEM formatted private key is not well formatted.
We used this in the function:
const privateKey = -----BEGIN PRIVATE KEY-----\n${googleSAPrivateKey.replace(/\\n/gm, "\n")}\n-----END PRIVATE KEY-----\n