Even when named with a name tag, wandering traders despawn after their DespawnDelay nbt tag reaches 0, which is inconsistent with the endermite, a mob with a similar despawning system.
How to reproduce:
- Rename a name tag in an anvil
- Summon a wandering trader with DespawnDelay set to 500 (note that with just "/summon wandering_trader", DespawnDelay will be 0, which prevents the wandering trader from despawning
- Use the name tag on the wandering trader
→ After DespawnDelay reaches 0, the wandering trader despawns