It's normal for mobs who hold weapons to drop them for a better weapon lying on the ground (if the mobGriefing gamerule isn't switched to false). However they should not be switching for equal weapons (because this creates a behavior loop). Someone discovered "The Sword Juggler" by afking at a zombie pigman farm late at night:
https://www.reddit.com/r/Minecraft/comments/dcquma/after_being_afk_all_night_in_my_pigman_farm_i/
Yes that's 100 or so golden swords being endlessly cycled through by the zombie pigman standing on them. He should be ignoring all of them because none are a higher level sword.
Thank you for your report!
This issue is being tracked in MC-193313, so this ticket is being closed as a duplicate.
If you have any additional info you'd like to share in the parent ticket, that'd be greatly appreciated!
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki