It's not really a bug. It's that unlike games like WoW, your character doesn't automatically turn to face the target while casting.
Solution? Right click and turn your character towards the enemy at all times. Unless their movements are so erratic that they're going through you constantly then it should work most of the time. And if that's so, you're probably not standing in the right spot.