Zombies do not "forget" unreachable targets
Zombie is targeting the secluded villager which was spawned first. This is acceptable behaviour. But once the zombie and the villager are grouped together and all lines of sight are taken away from the original target villager the zombie will under no circumstance switch targeting to the villager which he can reach


