Pathfinding waypoints being created in an existing part

I’m trying to pathfind a entity to a target position but the pathfinding waypoints are being created in the ramp part resulting in the entity getting stuck, this is the code:

function entity.pathToTarget(targetPosition: Vector3)
	local newPath: Path = PathfindingService:CreatePath({
		AgentRadius = entityRootPart.Size.Z,
		AgentHeight = entityRootPart.Size.Y,
		AgentCanJump = false,
		WaypointSpacing = 3
	for _,wayPoint: PathWaypoint in ipairs(newPath:GetWaypoints()) do

This is how the path generates:

Don’t use pathfinding often so I may be missing something. Thanks.