Code not valid with authorization_code as grant type

Hello All,
I am getting error “code not valid” with authorization_code as grant type. I am trying to exchange code for access token. Can anyone please help.
Is there any way to skip the token exchange and get directly the access token from keycloak ?

{
“error”: “invalid_grant”,
“error_description”: “Code not valid”
}