it was failing here (only in query rewrite [i.e. when filters could not be resolved in service results], and only when dataset.name was with wildcard).

this had mongo_query['spec']={dataset.name: '<PK>'} which did not pass dataset wildcard validation in DASQuery.
which consequently through unexpected WildcardMatchingException, and resulted in '500 Internal Server Error' shown to user.