PKCE code_verifier mismatch on Genesys Cloud SPA login

Building a custom SPA for WFM metrics and trying to implement Auth Code flow with PKCE. The token exchange fails with 400 Bad Request and error invalid_grant.

// Generating code_challenge
const params = new URLSearchParams({
 code: authCode,
 redirect_uri: window.location.origin,
 grant_type: 'authorization_code',
 code_verifier: verifier,
 client_id: process.env.REACT_APP_CLIENT_ID
});

Verified the verifier matches the base64url hash sent in the initial request. Is there a specific character encoding issue with the Genesys token endpoint?