So we seem to have discovered a bug in Minecraft, at least with survival multiplayer.
Mobs that are named are not supposed to despawn when the chunk is unloaded.
Mobs that are named using the name tag also never despawn in the world, similar to tamed mobs. The exceptions are wandering traders or if the mob is hostile and the difficulty is switched to “Peaceful“.https://minecraft.gamepedia.com/Name_Tag
And if a named villager is turned into a zombie, it should keep its name, and not be despawned due to mob capping limits.
A named villager keeps its name when transformed into a zombie villager, and a named zombie villager keeps its name when cured.https://minecraft.gamepedia.com/Name_Tag
When a mob is named, it does not count toward the mob cap.
Except when we tested it on MyMinecraft (1.15.2), that’s not what happened at all. My named villager “Bait” was turned into a named zombie villager all right, but he also immediately despawned when the chunk unloaded.
It’s not a situation that would come up very often, but it definitely does come up, as it did for one of our players. Thanks to Gentle for bringing this to my attention!