This happens if you assign troops to a different group, ( outside the usual 1-4) .For example I often assign companions to a different group number, or green troops i want to break in gently. In bandit camps and village maps though this can spawn them in isolated areas.
I try to make a point of checking this before such encounters. I don't think its intended.