I have found that sometimes pets do not come out of a room with the owner if they haven't been commanded to follow as the last command. For example, you command the pet to kill then hide. If the room ends and the pet is too far away then it doesn't get kicked from the room, and gets deleted when the room resets...