My villagers are dying off in my trading hall in my realm. I thought they were killed by mobs at first but that is not the case. They were slowly vanishing over time. I finally caught one in the act of dying while entering the trading hall. He was just lying in his bed and suffocating. This happens eventually to all of the villagers in the hall repeatedly. I repopulated it three different times before I finally caught it happening.
I have attached several pictures to show the layout of the hall. There you can see the dimensions of their rooms, the light levels, and the verification that mobs cannot reach them through corners from the outside or anything.
Hopefully this is not a duplicate. It may explain why many players are having their villages become seemingly abandoned or thinking that their villagers are despawning.