I’m not sure it is exactly the same, because “x hat” and “x large hat” work! Since the hats are anonymous kind instances, their official names are “hat,” and so “hat” is understood as referring to them.
However, adding Understand "hat" as a hat
does fix the issue, so perhaps using the kind name for an anonymous instance doesn’t combine with understanding by relations.
EDIT: Link to the other thread for anyone curious.