How to make NavMesh Agent destroy walls to reach a destination?

I am making a game where the player can put down walls and defend from a horde of zombies. Problem is the zombies(Navmesh agents) cannot recognize if the player blocked himself with walls. Yes, the zombies do stop when they reach a wall(If the player blocked himself), but when the player moves, the zombies recalculates the path and reach another wall.

I tried NavMeshAgent.hasPath but it always returns true on the above scenario. When I tried to find the NavMeshPath.corners of the zombies path, the path seems to not recognize that there is an obstacle they are avoiding.

I am using NavMeshObstacles for the walls.

A raycast. If hits a wall, start coroutine “AttackWall”.