PathfindingService is not pathing around a corner or through holes in walls


PathfindingService can’t find the chest when the chest is right next to it, just around the wall. Why is this and how do I fix it? The chest is a part and the position is correct.
Script:

local PathfindingService = game:GetService("PathfindingService")

local Humanoid = script.Parent.Humanoid
local Root = script.Parent:FindFirstChild("HumanoidRootPart")
local goal = game.Workspace.Ignore.Items.CHEST.Position
local pathParams = {
	AgentRadius = 2,
	AgentHeight = 5,
	AgentCanJump = true,
}
local path = PathfindingService:CreatePath(pathParams)

function compute()
	goal = game.Workspace.Ignore.Items.CHEST.Position
	path:ComputeAsync(Root.Position, goal)
	if path.Status == Enum.PathStatus.Success then
		print("Yay")
	else
		print("Nay")
		wait(1)
		return compute()
	end
	local waypoints = path:GetWaypoints()

	for i, waypoint in ipairs(waypoints) do
		print("Pathing")
		Humanoid:MoveTo(waypoint.Position)

		if waypoint.Action == Enum.PathWaypointAction.Jump then
			Humanoid.Jump = true
		end

		Humanoid.MoveToFinished:Wait()
	end
	wait(1)
	return compute()
end

compute()

The character also seems to be incapable of pathfinding through gaps in walls. It seems to be random whether it works or not, usually choosing not to work.

Have you checked for invisible parts with collisions because for me it’s working just fine
robloxapp-20250104-2101215.wmv (1.0 MB)

Also setting the goal twice seems redundant