my pet never switches target unless i tell it to and it never breakes mez unless i havent disabled protect. and even with protect it will usually finish of the one mob first that i sent it to attack before.
so my guess is either you are bugged or you are pressing pet attack by accident while having targeted a mezed mob.