Minecraft wiki entry for Name_Tag, associated text: A named silverfish that goes into a block appears to lose its name because it is replaced by a newly-generated unnamed silverfish when the block is broken.
A baby (animal or villager) keeps its name when becoming an adult.
A named villager keeps its name when transformed into a zombie villager.
A named zombie villager keeps its name when cured.
Wandering traders still despawn even if they are named, or in a minecart or boat.