[[ RefactorSyntax ]] Fixes crash on queryRegistry with a type expected