We all know who we truly are, but some have gotten lost within a web of lies about themselves that has essentially sneaked up on them over the years. It's not so much that they consciously pretend to be someone they're not, they have simply forgotten who they truly are.
When faced with "just be yourself" these guys think of being the person they think of themselves as. What it actually means though is to act in accordance to your core values, not the superficial image.
The solution isn't to invent a new way of being, it isn't even to discover a way of being, it is to remember who you truly are and what you stand for. Everyone already knows who they truly are, but some people have buried their truth so deep they don't know who they are anymore.
I personally went into the self-improvement scene expecting to learn something new, what I ended up with was discovering what I already knew and remembring who I am. I was a bold kid with a very strong personality. Somewhere along the way I forgot I was ever like that and started believing that I'm this introverted and anxious dude. No joke, the sheer courage I had in my childhood was totally blocked out and I can't fully comprehend how I forgot this aspect of myself for about a decade.
I started trying to learn how to be bold, how to assert myself and of course how to talk to chicks as if I never knew how to. It never felt natural to me, that is until for some reason an old memory seemingly at random surfaced. That prompted me to dig deeper into it and see what else I might have forgotten. I realized at that time that I already knew all this, I had lived it in my childhood without even having words to articulate it. Instinctual, natural, already there.
I didn't need to "discover myself" as people often say, I just had to remember who I truly am instead of believing the lie I had convinced myself of over several years.
So yes, I agree, if you have forgotten who you are or you believe you are someone other than who you truly are then it is bad advice to "just be yourself". Because "yourself" is associated either to nothing or to a lie, sometimes so convincing that we even believe it to be our true selves.