Hello Odin,
To me, the trailing slash in the
requestJira(route`/rest/api/3/project/${projectKey}/roles**/**`);
…looks suspicious. Have you tried execute the request without it? I.e. /rest/api/3/project/${projectKey}/roles
as per
- Unauthorized; scope does not match -Scopes changed? - #2 by Dario_B
- https://developer.atlassian.com/changelog/#CHANGE-1320
What exact error have you got in your 401 responses? Is it “Unauthorized; scope does not match”?