It may not work if the key does not exist for a specific unitframe.
Example for PlayerFrameManaBar
https://github.com/tomrus88/Blizzard...Frame.xml#L345
It has no key for
manaBar.
PlayerFrame.manaBar does not exist.
You have to use
PlayerFrameManaBar.
Phanx posted you a solutions that works for unitframes that have keys referencing specific child objects.