Client network socket disconnected before secure TLS connection was established - Google Drive API

netlify app: https://boisterous-hotteok-cd3364.netlify.app/
custom domain: https://www.eatauburn.com

I am using google drive upload API to upload images to a google drive.

Credentials and google drive set up are correct, I am able to post images to the google drive (and see them in the drive) when developing and running my app locally.

Once deployed, any time I attempt to upload images I am met with this error:

Oct 15, 09:59:18 AM: 3a9b319f INFO   FetchError: request to https://www.googleapis.com/oauth2/v4/token failed, reason: Client network socket disconnected before secure TLS connection was establishedOct 15, 09:59:18 AM: 3a9b319f INFO       at ClientRequest.<anonymous> (/var/task/node_modules/node-fetch/lib/index.js:1505:11)Oct 15, 09:59:18 AM: 3a9b319f INFO       at ClientRequest.emit (node:events:514:28)Oct 15, 09:59:18 AM: 3a9b319f INFO       at TLSSocket.socketErrorListener (node:_http_client:501:9)Oct 15, 09:59:18 AM: 3a9b319f INFO       at TLSSocket.emit (node:events:514:28)Oct 15, 09:59:18 AM: 3a9b319f INFO       at emitErrorNT (node:internal/streams/destroy:151:8)Oct 15, 09:59:18 AM: 3a9b319f INFO       at emitErrorCloseNT (node:internal/streams/destroy:116:3)Oct 15, 09:59:18 AM: 3a9b319f INFO       at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {Oct 15, 09:59:18 AM: 3a9b319f INFO     type: 'system',Oct 15, 09:59:18 AM: 3a9b319f INFO     errno: 'ECONNRESET',Oct 15, 09:59:18 AM: 3a9b319f INFO     code: 'ECONNRESET',Oct 15, 09:59:18 AM: 3a9b319f INFO     config: {Oct 15, 09:59:18 AM: 3a9b319f INFO       method: 'POST',Oct 15, 09:59:18 AM: 3a9b319f INFO       url: 'https://www.googleapis.com/oauth2/v4/token',

Here is the route that the application will post to when submmitting attachments:
https://www.googleapis.com/auth/drive

I am using client credientials that are hard-coded into the application, so it is not the case that the application is failing to find the correct credentials.

For further context, these requests are made to google drive from my backend. Would this code need to be moved to the netlify/functions directory for any reason?