I misunderstood your earlier question. Once "invented" (your term) such a feature could be inherited by the posterity of the creature possessing such a mutation. I thought you were asking if mammary glands could also appear elsewhere on the tree, thus my response about the raw material which gave rise to the original mutation. If it still exists in the "parent" stock, I suppose the same (or perhaps similar) mutation could pop up again, in a new branch (thus my platypus comment). As you say, this seems to happen with eyes.
If something exists in your parents, you may well just inherit it. It doesn't have to pop up again, it never went away.
Here's where gore and some others confuse people by trying to say that the platypus doesn't fit the tree. It does. It's a mammal. It comes away from our branch even before the invention of the marsupial pouch, but it's a mammal.
It inherited the mammary glands from the common ancestor of modern mammals.
But why didn't T. rex inherit mammary glands from anybody?