This is because Dracorich will not change to melee mid-ranged attack, but he does change targets if someone new is placed in range before he completes it. The first time you placed her, you'd done so you placed her before he began a ranged attack, probably placing her as he was walking forward to the position. After that you timed it to place her while he was in the middle of his ranged attack animation, which has a somewhat long pre-attack portion, and so he finished said ranged attack before swapping to melee.