I second what @json2828 says.
I travel a lot to spaces that are 1000+ block distant. On my first visit everything seems fine, but when I go back a second or third time after travelling a lot, when I come back my villagers have all disappeared (even those that have been protected).
I also happened to some of my wolves (named and unnamed) when I returned back at my home base after such a trip. As mentioned in the previous, I travel with a bed that I use frequently during my travel.
it is more apparent with villagers, since all villagers in a village disappear at once, but I’m pretty sure it can happen with any mob.
I don’t think this happens for aggressive mobs that spawn in certain areas like woodland mansions and pillagers outpost, but it would be hard to tell since these structure create spawn areas, so even if the pillagers despawned, new ones would spawn back, which is not something that happens with villagers or domesticated wolves. Once they are lost, they stay lost.
I can also confirm that this isn’t something that seems related to a specific world. if you look to all the other bug report that have been closed as duplicates to this one, you can see that it just seems to be something that happens every so often when players explore far away and come back.
I get the same issue. At least six villages in my world have completely despawned that way, In one of them there were villagers that I had secured in their houses and they still disappeared. So far it’s been an all or nothing for me, either the village is fully populated or mob disappears (villagers & golem).
I also had one named and one unnamed wolf that were sitting in a secure location that disappeared. It is a very annoying issue.
Just to keep this alive and provide more updates. I just have all my bees disappear after I returned from an exploration expedition.
I have a few beehives at my homebase, all had around one to three bees per beehives.
When I returned I no longer had any bees at all.