Items cannot be renamed in an anvil without combing/repairing an item in the same action. The item does not appear in the removal slot of the anvil GUI after it is renamed and a red X appears over the arrow. It is therefore impossible to rename nametags. Experiencing this bug on a realm.
Thank you for your report!
We're actually already tracking this issue at REALMS-9214, so we will resolve and link this ticket 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:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki