NavMeshAgent stops when player is in inaccesible area

My NavMeshAgents are following my player around the scene which works fine, the issue is when I enter a zone they cannot access, they stop moving until i leave to an area they can reach me from. The weird issue is, even though they stop and cannot reach me, their pathStatus shows as pathCompleted rather than PathInvalid. Is there a reason for this?

Preferably, I would like them to go to the last position of the player before entering the inaccessible area. Is there a way I can achieve this?

if (agent.enabled == true)
{
	agent.SetDestination(currentTarget.transform.position);
	
	//I could say
	//If PathInvalid
	//Go to last known point
}

As in my comment, if their path status showed as Invalid, I could use that as a starting point, but it never shows invalid.

It’s possible but you’ll need to keep track of the last valid player position yourself and then when the player enters an invalid area set a new destination to that last valid position.

Not sure why Unity is returning that the path is completed rather than invalid. Maybe a bug in their code?