On Minecraft Realms there seems to be a text-parsing issue in the Realms server code that rejects Name Tag input via the Anvil. This affects all items.
It is assumed that it is a text-parsing issue due to this coinciding with a similar but separate issue where signs go blank (on Realms servers). Please do not remove this as a "duplicate issue", it is yet to be resolved.
Steps to reproduce:
Pay money for Realms server.
Build an anvil. Find item you'd like to name (for example a Name Tag).
Place item in Anvil.
Use On-screen Keyboard to input new name for item.
Attempt to take the renamed item from the Anvil.
Expected result: you receive the item, you lose 1 level of experience, the item is renamed, and the Anvil receives some damage.
Actual result: item returns to first slot, you don't lose any experience, the item is not renamed, and the Anvil receives some damage.
Related issues
Comments

Thank you for your report!
We're tracking this issue in REALMS-9214, 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
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki – 📖 FAQs
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.