Right, well, with the legend it appears that the legend add-on uses the master.baseID property, not the master.Name or master.NameU to identify the shape. So, if one master has been created by copying and modifying another then both have the same BaseID. This is how many of my shapes were created.
This is why there are several reports of the legend addon doing strange things, sometimes. It relies on a poorly documented feature (well, it's not at all obvious is it).