I captured a baby ocelot with a lead from a nearby jungle biome and keep it inside some spruce fences over a frozen lake, but when I went away for a while it had despawn. Later on I captured a grown up ocelot in the same fences, and it despawn in the same way. I'm not sure if it's because the floor inside the fences is made of ice, or because it needs a name tag, which I didn't had at the moment (nor an anvil), but I know most animals inside a fence never despawn if it's more little than about 20 blocks, and mine is 7 x 7 blocks, so it should be fine. And by the way, when the ocelots despawned they were a horse and a sheep inside the same fence, but luckily they never despawned and are still there. Maybe the ocelots were made to despawn because they always got stuck between the jungle leaves and holes and created too much lag? But in any case, it will be cool before it despawn to check around it if it's inside some fences or no, to decide it has to despawn or no, like the other animals do correctly.
Thank you for your report!
However, this issue has been resolved as Working as Intended.
See
Fix note
in MC-28424The report you have submitted is working as intended, mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – Feature Requests and Suggestions
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki