Also make sure the alt has the target before using /petattack.

iirc the default behaviour for the pet attack command is to attack the nearest target if you have nothing selected. So if there's a delay in the alt assisting you, the pet will potentialy attack something else