Why doesn't my ray detect certain faces?

I’m making a rifle, but the ray (bullet) doesn’t detect certain faces of the part it’s hitting.

SERVER SCRIPT

local tool = script.Parent
local handle = tool.Handle
local re = tool.RemoteEvent
local rf = tool.RemoteFunction
local debris = game:GetService("Debris")
local holding = false

re.OnServerEvent:Connect(function(player, hold)
	if hold and not holding then
		holding = true
		while holding do
			local origin = handle.Attachment.WorldPosition
			local mousepos = rf:InvokeClient(player)
			local direction = (mousepos - origin).Unit
			local distance = (mousepos - origin).Magnitude
			local posss = direction * distance
			print(distance)
			
			local rayparams = RaycastParams.new()
			rayparams.FilterType = Enum.RaycastFilterType.Exclude
			rayparams.FilterDescendantsInstances = {
				tool,
				handle,
				player.Character
			}
			
			local ray = workspace:Raycast(origin, direction * distance, rayparams)
			if ray then
				print("This doesn't print.")
			local result = ray.Instance
			local raypos = ray.Position
			local hitmodel = result:FindFirstAncestorOfClass("Model")
			local actualDistance = (raypos - origin).Magnitude
			local midpoint = origin + direction * (actualDistance / 2)

			local part = Instance.new("Part")
			part.Anchored = true
			part.CFrame = CFrame.lookAt(midpoint, origin)
			part.Material = Enum.Material.Neon
			part.Color = Color3.fromRGB(255,255,0)
			part.Size = Vector3.new(0.1, 0.1, actualDistance)
			part.CanCollide = false
			part.Parent = workspace
			debris:AddItem(part,0.1)
			
			if hitmodel and hitmodel:FindFirstChild("Humanoid") then
				local humanoid = hitmodel.Humanoid
				humanoid.Health -= 10
			end
			
			task.wait(0.25)
			end
		end
	else
		holding = false
	end
end)

LOCAL SCRIPT

local tool = script.Parent
local re = tool.RemoteEvent
local rf = tool.RemoteFunction
local uis = game:GetService("UserInputService")
local hold = false

rf.OnClientInvoke = function()
	return game.Players.LocalPlayer:GetMouse().Hit.Position
end

uis.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		if not hold then
		hold = true
		re:FireServer(hold)
		end
	end
end)


uis.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		if hold then
		hold = false
		re:FireServer(hold)
		end
	end
end)