There been a couple of time that this has not been working properly for me.

For Instance:
Auto Attack engaged on a boss, his hp is going down, and the suddenly target locks on to another subject, in this case it was a chest.

Also I target line occasionally turns invisible, I experienced in Swamps too, but it has been happening in Oasis as well.