The bug
Based on Bug Of The Week 18: Mobs Equipping Armor With Dispensers
Mobs equipping items from dispensers can despawn.
How to reproduce
Summon a monster which can pick up loot
/summon husk ~ ~ ~ {CanPickUpLoot:1b}
Place a dispenser facing it and put for example a carved pumpkin inside
Activate the dispenser
→ ✔ The monster is wearing the pumpkinTeleport away and then back to make sure it could despawn
/teleport @s ~ ~ ~1000 /teleport @s ~ ~ ~-1000
→ ❌ The monster despawned
Confirmed for all versions since 1.9.