The CallCompanion function appears to throw the error "You do not have a pet" for critters, I don't know if this is just a bug or if you won't be able to use that function any more. In fact, it does the same thing if I try to summon it using /cast <Pet Name>.
I'm not sure exactly what you're trying to do, but I've written a function which will, for the moment, summon a pet by name on the beta. These functions seem like they might be subject to change.
Lua Code:
function CallPetByName(petName)
local _,myPets = C_PetJournal.GetNumPets(false)
for i=1,myPets do
local petID, speciesID, isOwned, customName, level, favorite, isRevoked, name, icon, petType, creatureID, sourceText, description, isWildPet, canBattle, tradable, unique = C_PetJournal.GetPetInfoByIndex(i, false)
if name:lower() == petName:lower() then
return C_PetJournal.SummonPetByID(petID)
end
end
print('Pet "'..petName..'" not found')
end
I've included what I believe to be an accurate list of the variables returned by GetPetInfoByIndex, even though you're only using 2 of them for this.