Minecraft wiki entry for Wandering_Trader, associated text: Wandering traders do not despawn if marked persistent, by setting the NBT tag {PersistenceRequired: 1b}, or setting manually with /data merge or /data modify‌[JE only].