Access Okta error using OIDC Request using javascript

Hi, Recently, our team implemented the OKTA (OIDC)in the LWR application using Javascript.Everything is working fine, but there is one problem. That is, when the particular user logs in and he is not assigned to that application, we need to redirect to OKTA’s default error page.
My code starts from the parseFromUrl If a user has no access, it will jump to the catch block of ParseFromUrl. In this catch block, we are not able to access any variables.
There is no configuration for the default error page for my OIDC application in the OKTA admin console.
Is it possible to configure the default error page redirection in OIDC Request?
If so, how can we add redirection to the error page in my oidc application?.

If a user is not assigned to an OIDC application and attempts to login, per OAuth spec (it’s an access_denied error), the error message is returned back to the application via the supplied redirect_uri. There is no way to show the Okta error page instead as that would go against spec