HubSpot Oauth APIs are robust and well-tested since all public apps are using them.
According to the Information you have shared, I believe that after using the refresh token to get the new access token, you might still be using the old access token for authentication and probably there would be a logical error in your code.
The access token expires even though I just got it.
SOLVE
hubspotClient.oauth.tokensApi
"receiving the response"
.create('refresh_token', undefined, undefined, YOUR_CLIENT_ID, YOUR_CLIENT_SECRET, YOUR_REFRESH_TOKEN)
.then((results) => {
console.log(results)
// this assigns the accessToken to the client, so your client is ready
// to use
hubspotClient.setAccessToken(results.accessToken)
return hubspotClient.crm.companies.basicApi.getPage()
})
The HubSpot Node Lib shares this example, in this case we are setting the accessToken on the API after receiving, Are you also updating the token received in the api after your first await in the snippet you have shared ?