When a stackable food item has the "using_converts_to" component applied via datapack or commands, it is initially treated as stackable, but does not properly maintain stackability.
When an item modified this way is dropped from a loot table, it will stack with other like items dropped from the same loot table as long as the world remains loaded. However, exiting the world and re-entering will cause all future instances of the same loot table entry to be treated as an entirely separate item, despite having identical item components. (See attached screenshot; the two meat shanks seen in the hotbar were generated in separate sessions and do not stack despite having identical food data).
Additionally, splitting one stack of such items in half and then attempting to re-stack them results in the two stacks becoming separate instances, preventing you from restacking them again.
I won't pretend to know exactly why this is happening, but my best guess is that there's some leftover code saying that food with containers shouldn't be stackable, despite the fact that eating the food while stacked drops the container item just fine. This is a really unfortunate bug, as it prevents the "using_converts_to" property from being usable for survival datapacks without creating a super annoying experience for the player.
To see this in action, download the attached datapack, add to a world, then summon and kill a bunch of Camels. They should drop modified Beef items, which will stack when you first pick them up. Then exit and re-enter the world and do the same thing to receive an identical instance of modified Beef that will not stack with the first one.
Thank you for your report!
We're tracking this issue in MC-272643, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki