I've noticed this happens infrequently - usually when an army of mine and some monster are in close quarters, with multiple ways blocked, often the monster will end up attacking me.
My guess is the pathing AI tells it that it's only option is to go through a spot I either recently occupied or it's imply the only option for it to move, nad I'm in the way, so it attacks.
Personally, I'm fine with that behavior - I think it's good, but it perhaps needs to be declared in the tool tip or the Hiergamenon as a possibility when getting the Master Scout trait.