Improved error message for cases where a nonterminal is used in a pattern but could not be imported