Naming more than one mob the same name causes all but one to despawn
I am playing on a realm which I have built a barn. I named all the animals so they would not despawn. I used a name tag and named all the pigs "Pig", all the sheep "Sheep", etc. When I come back to the realm and load in, all the mobs with the same name except one will have despawned. So now I just have one of each animal.