Freshsales oauth token is not regenerating

We have built a custom app for Freshworks CRM, which relies on OAuth tokens for third-party integration. The OAuth token is automatically regenerated when it expires. However, we have encountered occasional errors during the token regeneration process. sometimes it’s not generating the token which would cause an error. Could someone help me with this?

Additional information:-
the custom app is built for integrating with the Docusign app

The functionality of the app-
The app will load the document templates from DocuSign on the contacts details page of the CRM.

**Error **
The app can be accessed from the contact details page. When we click on the app, it initiates an API call to DocuSign for loading the list of document templates. However, we are encountering a recurring issue where it keeps loading, and we receive an OAuth token failure error. This problem used to occur occasionally, but it has become more frequent recently.

Console logs for your reference.
“status”: 401,
“headers”: {
“cache-control”: “no-cache”,
“pragma”: “no-cache”,
“content-type”: “application/json; charset=utf-8”,
“expires”: “-1”,
“x-docusign-tracetoken”: “da30ac24-f5ab-4e45-b2c9-0de59a42e9d0”,
“x-docusign-node”: “CH2FE30”,
“strict-transport-security”: “max-age=31536000; includeSubDomains; preload”,
“referrer-policy”: “no-referrer,strict-origin-when-cross-origin”,
“x-content-type-options”: “nosniff”,
“date”: “Mon, 31 Jul 2023 12:51:15 GMT”,
“content-length”: “87”,
“connection”: “close”,
“vary”: “Accept-Encoding”
“response”: “{"error":"internal_server_error","reference_id":"da30ac24-f5ab-4e45-b2c9-0de59a42e9d0"}”,
“errorSource”: “APP”,
“attempts”: 1


Have you followed the following config setup process for Paith using freshworks native oauth functionality link here: OAuth

If so could you share your oauth config with the keys redacted and also check if keys are not being generated or if the renewal of keys is the issue ?