Why are some mobs disappearing?

Solution 1:

One commonly looked over bugs that may have caused this is that leads will sometimes break when reloading chunks. If your horse was on a lead, there is a chance that it didn't actually disappear; it may have just left.

From the information on this page, if a creature is tamed by a player, it is given persistence and cannot despawn. Your pigs and cow would not have had this and therefore could have been subject to despawning. It is most likely that the lead for your horse simply broke and the missing farm animals just despawned.

Hope this helps!

Solution 2:

There's a bug where horses can randomly suffocate in walls. I had multiple horses die when trapped in 2×2 areas completely surrounded by walls.