Sometimes, the issue might be on QuickBooks' side. You could check the QuickBooks Developer API status page or look for any updates in forums to see if there are any ongoing problems with their OAuth service.
If you've already checked the variables and the request format, try adding more detailed logging. Focus on logging the full response from QuickBooks, as it might give you more information about the error and help you figure out what’s going wrong.