Whether it's bad or good is hard to say as sometimes hiding yourself can protect you for a time in certain situations. Though refusing to open yourself up to others irl can have an affect on your mental health over an extended period.
So yes, it is bad for your mental health to hide your true self. However, if you do not have a healthy outlet to open yourself up to, like a trusted friend IRL, then it can be more harmful to your mental health.