Minecraft wiki entry for Wandering_Trader, associated text: When playing on a small remote island, wandering traders usually spawn in the water. The game prefers spawning them on the world surface, but they can also spawn underground if the player is more than 48 blocks from the surface and the spawn attempt occurs on a solid surface in an open volume.‌[Bedrock Edition only]