Is this a bug or what?
It’s because the pet is acting before it has time to turn/reposition itself towards its intended target. Just another known issue with pets.
I’ve not had this problem very much, or have just not really noticed it enough to care; but I have heard about it before.