that's not a bug, that's the current implementation of the "swarm" feature.
I don't think it's very well explained in-game yet. i believe one of the videos in the tutorial mentions it, but other than that i think there is little to no indication what actually happens.
AFAIK the current implementation of "swarm" (or flanking as you called it) adds 1 accuracy and 1 attack(damage) to the attack for each person in adjacent friendly units. it's currently represented by the melee swing animation, though i think the devs already acknowledged that the animation may be confusing and that they think of other ways to better communicate what's happening.