I have experienced this bug and have lost over a hundred chickens, cows, and pigs and losing master level villagers. The only work around I have found is using the lead to tie your animals up as I haven't experienced those mobs despawning when I get this bug, though it doesn't help protect your villagers as you cant lead them, nor if you have dozens and dozens of farmable mobs as it would be an extreme inconvenience, so if you have a certain horse or something you want to protect, kead them and they should hopefully be safe from despawning.
I have experienced this bug and have lost over a hundred chickens, cows, and pigs and losing master level villagers. The only work around I have found is using the lead to tie your animals up as I haven't experienced those mobs despawning when I get this bug, though it doesn't help protect your villagers as you cant lead them, nor if you have dozens and dozens of farmable mobs as it would be an extreme inconvenience, so if you have a certain horse or something you want to protect, kead them and they should hopefully be safe from despawning.