Are you still having issues with getting your refresh token and initial access token? I'm happy to take a look at what's going on. Could you let me know how you're making the request? Which URL are you making your request to? And how are you passing the authorization code? Just to confirm, you're using the endpoint documented here: https://developers.hubspot.com/docs/methods/oauth2/get-access-and-refresh-tokens, right? From that endpoint you can exchange your authorization code for the refresh token and an initial access token.
I was having this problem and it turns out that copying the secret and client form my app settings page included a newline, which was encoded into the request on postman. Took me a whole day to figure this out but yeah, I finally removed the encoded characters from the request and inspected the key-value fields and sure enough they had a newline.