That could work!
I mean, it really depends on why the guards are protecting these items in the first place. But since there's no story explaining that, them shooting you only after acquiring treasures, seems plausible.
another thing that could work is if there is a bandit chasing you and you have a valuable item and you drop it then they could stop chasing you