Mobs won't pathfind through areas between fences and walls, that they are able to fit through.
How to reproduce
Build a setup similar to the attached image, such that there's a roughly 1-block gap between the fence and the wall where the chicken can fit.
Hold seeds so the chicken follows you.
Notice how the chicken refuses to walk through the gap that it can fit through.
Related issues
Attachments
Comments

[media]

Duplicate of MC-21109.