I noticed %%n works fine in a return "%%n" put into a custom display function. But if in the custom display function I use it for a check in a UnitBuff("%%n", "Buff name") it returns null even if I know for a fact that buff is on that player (and %%n actually reports a specific player name). It even returns null even if I assign local name = "%%n" and I double check that return name works fine!
Something clear is that an equality check of "%%n" == "String" does not return true even if a return "%%n" and a return "String" appear to show the exact same thing. I wonder if %%n includes invisible formatting that breaks it.