I had 4 hostile mobs each named tagged and placed in a single chunk in 2 locations (2 mobs each) and they all despawned when I changed the difficulty to peaceful. All mobs did not despawn even when unloading chunks and reloading chunks. They despawned after i relogged in the realm 8+ hours later.
Comments 2
Reopening and resolving as WAI, the report isn't related to MCPE-21416 which tracks random despawns.
Hostile mobs will despawn when changing from a standard difficulty to peaceful. To suggest new functionality please head over to https://feedback.minecraft.net.
I have confirmed that named hostile mobs will still despawn when the game is switched to peaceful mode. When traversing the Nether i switch it to peaceful which confirms why they despawn. Piglins do not despawn in peaceful but are not hostile. Maybe add this feature to named hostile mobs? Just a suggestion.