مَا ضَرَبَ زَيْدٌ إِلَّا عَمْرًا
Zayd struck no one except Amr.
مَا ضَرَبَ عَمْرًا إِلَّا زَيْدٌ
No one struck Amr except Zayd.
The first restricts the object; the second restricts the agent. Similar lexical material therefore carries a different qasr relation when syntax changes.
Case endings, the verb's participants, and the position of the exception must all be taken into account.