About my previous comment, I should probably mention that in my world, I have many, many villagers in a city. It is enough that I need to lower specs to play smoothly. This bug seems to happen only in the most densely populated parts of my city. I lowered my simulation and render distance but it did not fix the issue.
I have this issue in my singleplayer world. I can confirm it happens all the time. Not just with save and quit, if I unload the chunk, the changes to the chunk's entities are not saved. I'm not sure if it happens to all entities, I haven't seen it with villagers.
I would be more than glad to give a copy of my world (which has some great stuff as bonus) but I play on mobile and I've no idea how to access my world files, if that is even possible. Spawn some 200 villagers, all with beds and professions, and you might have similar conditions and maybe even replicate the bug.
My friend told me it could be "lack of RAM" but to save and quit is a process that can take as long as it is needed, so I don't believe that.