suggestion on a fix will cause more problems than the one it proposes
to fix. It necessitates that holding pens must have walls. 100% of my
pens will then no longer work.
Besides, this is all moot.
Extreme Hill biomes no longer spawn cows, pigs and sheep specifically to
address the issue of them getting stuck on ledges.
1. When I said "walls", I'm counting anything that can act like a wall (over 1 block high). This means as long as your animals are within a fenced or walled-in area, they will not despawn... The only way they would be able to despawn if you have a hole in the "wall" (or floor) for them to get out from (either through walking out or just flat-out falling out).
2. This problem is happening on the newest update for me.