And I'm saying it don't work, I play with a group of 4 others, 5 in total, we somewhat are loyal fans of JL2579, extremists if you will, and spent 2 days testing animal behaviors spawning/despawning.
... and I'm saying that removing all the grass from your pens doesn't work if the pens are too large in the first place. Removing the grass does prevent additional animals from spawning inside the pens, but it does not prevent animals from despawning from a pen that is larger than 20 blocks. IF your pens are small enough, you can go farther than 20 blocks away from your animals and they will not despawn. It doesn't prevent the animals from occasionally spawning outside there pen when the game is exited and entered.
Staying within 20 blocks of any animal (wild or tamed) with prevent it from despawning, but standing within 20 blocks of an animal in a pen when you save and exit the game will not prevent it from respawning on the wrong side of the fence when you re-enter the game. If you don't notice that it has respawned on the wrong side of the fence, it may disappear by virtue of merely walking away. That is, not all animal disappearance are despawns.
In addition, sheep may also disappear from pens by virtue of wolves attacking them from outside the fence. You may or may not notice the drop of wool before it despawns after 5 minutes.
No single technique works 100% with this because it is a multilayered problem.
... and I'm saying that removing all the grass from your pens doesn't work if the pens are too large in the first place. Removing the grass does prevent additional animals from spawning inside the pens, but it does not prevent animals from despawning from a pen that is larger than 20 blocks. IF your pens are small enough, you can go farther than 20 blocks away from your animals and they will not despawn. It doesn't prevent the animals from occasionally spawning outside there pen when the game is exited and entered.
Staying within 20 blocks of any animal (wild or tamed) with prevent it from despawning, but standing within 20 blocks of an animal in a pen when you save and exit the game will not prevent it from respawning on the wrong side of the fence when you re-enter the game. If you don't notice that it has respawned on the wrong side of the fence, it may disappear by virtue of merely walking away. That is, not all animal disappearance are despawns.
In addition, sheep may also disappear from pens by virtue of wolves attacking them from outside the fence. You may or may not notice the drop of wool before it despawns after 5 minutes.
No single technique works 100% with this because it is a multilayered problem.