After leaving town through a town portal, companions end up at whatever entrance you originally used to enter the non-town area instead of where the portal was. This can be far away from the player.
Enter a non-town area.
Move away from the entrance.
Go through the portal to town.
Go back through the portal to the non-town area.
Player will be where the portal was, pets will be at the area entrance.