Pets with humanoids still colliding with players

I’m trying to allow players to walk through pets following them that have humanoids, but no matter what, they can’t walk through the humanoids. Here’s my code currently:

local PhysicsService = game:GetService("PhysicsService")
PhysicsService:RegisterCollisionGroup("Players")
PhysicsService:RegisterCollisionGroup("HumanoidPets")

function playerAdded(player)
	local character = player.Character or player.CharacterAdded:Wait();
	for _, part in pairs(character:GetDescendants()) do
		if part:IsA("BasePart") then
			part.CollisionGroup = "Players";
		end
	end
end


for _, pet in pairs(game.ReplicatedStorage.PetModels:GetChildren()) do
	if pet:FindFirstChildWhichIsA("Humanoid") then
		for _, part in pairs(pet:GetDescendants()) do
			if part:IsA("BasePart") then
				part.CollisionGroup = "HumanoidPets"
			end
		end
	end
end

game.Players.PlayerAdded:Connect(playerAdded);

for _, player in pairs(game.Players:GetPlayers()) do
	playerAdded(player);
end

PhysicsService:CollisionGroupSetCollidable("Players", "HumanoidPets", false)
PhysicsService:CollisionGroupSetCollidable("HumanoidPets", "HumanoidPets", false)
PhysicsService:CollisionGroupSetCollidable("Players", "Players", false)

Well did you set the collision group for Pets and Players to be unable to collide with each other?
If not, then thats the issue!

(if thats not the issue, then idk, we probably need more information)

Hello! Thank you for your response! At the bottom of the script I do with this:

PhysicsService:CollisionGroupSetCollidable("Players", "HumanoidPets", false)
PhysicsService:CollisionGroupSetCollidable("HumanoidPets", "HumanoidPets", false)
PhysicsService:CollisionGroupSetCollidable("Players", "Players", false)

Let me know what information you need!