when you name tag an animal or villager ect they are still despawning even when in an enclosed structure of less then 20 x 20.
Related issues
Comments

when you name tag an animal or villager ect they are still despawning even when in an enclosed structure of less then 20 x 20.
migrated
(Unassigned)
Unconfirmed
Multiple
Xbox one bedrock
1.18.12 Hotfix
Retrieved
It is recommended to make enclosures entirely inside a single chunk so mobs can't reach the border (14x14 maximum). That can reduce despawning from crossing chunk borders.