After the recent update to the @node-oauth/oauth2-server package to version 5.0.x, there is a bug related to error evaluation.
The main issue arises when an error is thrown from @node-oauth/express-oauth-server, which still uses @node-oauth/oauth2-server version 4.3.0. Due to this version discrepancy, the error instances from the older version do not match those from the new version 5.0.x, leading to compatibility issues.
Just pointing out the issue as there is already a PR which updates the version of @node-oauth/oauth2-server to the latest one.