وَاسْأَلِ الْقَرْيَةَ
Ask the town.
A grammatical explanation can supply an omitted genitive head, “ahl,” yielding “ask the people of the town.” A rhetorical explanation treats “al-qaryah” itself as used for the inhabitants through metonymy.
These explanations operate at different analytic levels: one describes an understood ellipsis, the other a relationship between the expressed word and its intended referent. A good answer identifies the level of analysis instead of treating every difference of phrasing as a contradiction.