2D grid graph agents as obstacles?

I’m fighting with a following problem and didn’t find a solution on the forums:

1)I’m doing a top down game on a quite tight grid, using 2D pathfinding
2)When an enemy goes into a tight corridor I want other enemies to consider this path blocked.
3)I add a dynamic obstacle that carves the grid around an agent.
4)But then agent sometimes gets distracted by own obstacle, trying to find a way around a path blocked by himself!

Ideally I would have an obstacle that’s being taken into account by all agents except the owner of the obstacle. Any ideas how should I implement it?