See this stack exchange question - Geoserver OAuth2 Community Extension - Java Runtime Error, possibly CORS?
I’m not sure what they have done but throwing a can never happen exception is bad we could at least give a clue
I was in a similar situation, and made a PR targeting the exception message.
[GEOS-11331] OAuth2 can throw a " java.lang.RuntimeException: Never should reach this point" by roarbra · Pull Request #7551 · geoserver/geoserver
See this stack exchange question - Geoserver OAuth2 Community Extension - Java Runtime Error, possibly CORS?
I’m not sure what they have done but throwing a can never happen exception is bad we could at least give a clue