What I expected to happen was...:
For the entity to not absorb the name tag.
What actually happened was...:
The entity absorbed the name tag, even though its name was the same as the one on the name tag.
Steps to Reproduce:
1. Rename entity to "X"
2. Attempt to rename the entity as "X" again.
3. Name tag is absorbed, even though the entity was already named "X".
Can confirm in 1.17.1. I've attached a video along with a screenshot demonstrating the problem.
[media][media]