If you give yourself a boat with this command:
/give @a minecraft:acacia_boat[minecraft:rarity=epic]
The name is of the item is now pink.
However if you place the boat down, break it, and pick it up, the boat loses its rarity component. At least in its name it becomes white as if i didn't have the rarity component.
The same is true if you give yourself a block with rarity. If you break the block, then pick it up, it loses the rarity.
It can be reproduced with the custom_name component as well.
Related issues
Comments


Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Relates to MC-91006
Update: I can confirm in 24w21b.