The redirect_uri must be one of the Authorized redirect URIs listed in the OAuth Client. The redirect_uri must exactly match one of the redirect URIs listed.
If what you are trying to do is to have a component, that runs server side, and that needs to connect, to authenticate and to get authorized with a Genesys Cloud environment, without a user being involved (I mean without a user being redirected to the Genesys Cloud login page to enter his credentials), then you would need to use an OAuth Client Credentials Grant flow.
Client Credentials is meant for that (server side application that connects to Genesys Cloud with just a ClientId and ClientSecret).
You would need to create an OAuth client, selecting Client Credentials as the Grant type, and assign the roles/divisions to this OAuth client (which will determine what the client is authorized to access from a Platform API standpoint).
There is also a tutorial available for client credentials grant.