Thats a common issue and it has everything to do with the attack command. You'll notice it more often with grunts/ogres/etc and using UC where you attack and run away, your units will want to go back and attack more unless you stand ground or stop commands. With peons it manifests itself in refusing to rep, go into a gold mine, or refuse to chop wood. The way you fix it is with the stop or standground commands depending upon which units are in the selected group. It has existed since the beginning of war2, way back when u were still pissing in diapers. If someone were to attempt to fix this bug programmatically, it would entail running the stop function BEFORE any other action. But then players would notice that units seem kinda sluggish when responding to new commands. IMO it shouldnt be fixed because the player is to lazy to use the stop hotkey.
The one bug that is more annoying than this is the dead block issue where mobile units will refuse to move to a block. This can result in a peon not being able to repair a building because the dead block is where the peon needs to stand to repair. This happens when a unit dies but it's not properly registered and thus that spot remains occupied even though nothing is there. I dont remember, but I think it also prevents placing buildings as well. Been a while since that one has happened, but then again, I dont play very often either so chances of seeing it are pretty slim.