You shouldn’t be storing your OAuth token in an environment variable like this.
First off, they expire, so whatever the token is will eventually die and the variable that gets built into your Next JS page will eventually be useless.
Secondly, for making requests in your NextJS page you should be using the Implicit Auth Flow https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-implicit-code-flow and using the token from that to make requests.
You would have a much easier time debugging if you log the variables used by your function so you know what you’re actually sending, and also logging the response body on a non-200 response so you can see what specifically the error is from Twitch (which in this case I expect to be an issue with the token you’re attempting to send).