yea they tend to respawn randomly out side the fence due to the fact that you/ the cows can be within the fence block (even tho the fence stops you) some time they are up against the fence before you save and quit and when they respawn when you log back on there is always the chance that they would spawn outside the fence. i have doubled the fence and i found that they are more likly to respawn inside the fence if the out side is obstructed (another fence or glass).
So yea this happens to me but i found that one way to stop it. i hope this helps
Trying it out, hope it helps. Any more ideas?
Ow, they also load out of blocks (baby cows). So i build a wooden plank cage for them, reloaded world, they were just out it. Or fell through the floor/suffocated in a wall....