It's both normal game function AND a bug!

It's normal for the game to assign the same name to more than one villager (as in real life - how many people do you know with the same name?)! There is also a bug that causes some villagers' names to change while scrolling through the details screen. When this happens, the affected villagers will always be "adjacent" to each other in the details rotation.