Note: I have no idea if this issue is duplicated by another issue or not. I tried to search " custom name" but I didn't found any confirmed issue that was as same as this issue. Not sure if I missed the issue or the issue is private. This also could be a feature request.
Note that some one have reported that the allay "spawn" outside the pillager outpost, which tracked at MC-263378.
STR (Steps to Reproduce):
Step 1: Create world with structures.
Step 2: Run this command: "/locate structure minecraft:pillager_outpost", then tp to the pillager outpost. If you don't see an allay cage, run this command: "/tp @s ~1000 ~ ~" and repeat step 2 until you find an allay cage.
Step 3: Go inside the allay cage by the hole in the ceiling, then lead the allay and fly out the cage by that hole.
Expect: The allay (or the player to make more sense) isn't able to go through the hole
Reality: The allay (and the player) is able to go through the hole
The hole between fences is 12/16th of a block, that's not a bug (it matches the fence's visual width). Pathfinding doesn't allow mobs to go through it though, only when forced through (just like you did in the video), because pathfinding is locked to the block grid (MC-21109), so no, that hole doesn't allow them to get out (by themselves).
This is a change request of either the structure, or fence width.