I have a feeling it may be class dependant. I think perhaps soldiers and engineers (and possibly medics) see the name of diguised people regardless unless they get very close. I think field ops and other coverts can spot spies at quite a considerable distance.
I know that I’ve had enemy players dishing out health to me when I’m in disguise and only low level covert experience. I also know that I’ve seen the names of enemy spies (the name of the guy they stole the uniform from) when I’ve been an engie at quite close distances.
It’s possible it’s a bug and that distance checking/name display code is a little unreliable. It’s possible the name display is decided by the server and if one person lags, the distance checks might become screwed up.
I still think it’s class related though.