I think the easiest way to do it would be to make it apply only if the action that consumes the item is coming up in the queue. If that's already how it works, you should add that to the quick reference so that it's actually documented that it happens somewhere; currently, the problem is that the behavior is unpredictable.
An alternative implementation would be to (1) make the check for having the exact equal amount of resources, instead of checking >=, and (2) allow queuing the same thing twice in a row so that if I want to fill up I can just add to queue twice.
In general I think the player should have more control over filling up on resources than they do currently; Increlution made the construction materials not filling up beyond what's required for constructions exclusive to low priority because it was assumed that if you set something above low you were intending on overgathering the resource! (This is mostly relevant for food components like mana and greenhouse harvests, but maybe someone wants extra fiber for some reason.)
(Also, I made a second comment, make sure to keep those in mind too!)