Ive had this happen a few times. if your main is a melee character and when your target dies and you press your attack button you automatically select the next target. if that target is across the room and in range your ranged will start attacking/shooting it.

all you can really do is watch your button spamming and make sure your "attack on assist" option is turned off on your clones or they will start shooting just by assisting you