The problem is because the way targets are decided isn't synchronized with the enemy's attack animation. Often times people leave the danger zone right after the red area disappears, but because the attack lands 1-2 seconds later, you still end up taking damage even if you're now nowhere near where the attack lands. This makes it easy to blame it on lag from a visual stand point, when really it's just the way the game is poorly programmed.

Even in your little GIF, you can see about a one second span between when the red area disappears and when the coblyn finally uses the attack. Who gets really should be decided when the attack goes off, not when the red area disappears.