Can you double check the URL you’re posting against?
OIDC flows require a post to a new enpoint:
https://api.twitch.tv/kraken/oauth2/token
If you post the code to the OAuth API, https://api.twitch.tv/kraken/oauth2/authorize, you’ll get a standard OAuth refresh token and access token