The issue with not being yourself is, more often than not, you seem fake to everyone around you. Likely because you are being fake. Telling someone to "be themselves" doesn't mean they go around everywhere talking about only the things they like and dismissing everything else. It means they don't pretend to be something their not.
For example, if you like anime, you shouldn't pretend you hate it just to get somewhere. That said, there are points where you might not want to bring up that you do like anime; that doesn't mean you're not being yourself, it means you're being tactful. You can be yourself and keep things to yourself at the same time. Another example would be if you have a foot fetish. You don't bring that up on a first date; again, it's being tactful, not not being yourself (woo double negatives!). Similarly, I don't walk in to bar and yell out that I love video games. If it comes up in conversation, I'll mention it, but it's not something you just go and bring up with everyone you come across.
There are definitely issues to not being yourself; you end up with people you don't like, you seem fake, you often get depressed and so on. But yelling out to the world that you are in love with an anime character probably isn't a good idea. Yet another example, I had a friend in high school who was a huge nerd, and advertised it. The people he hung out with liked him for it; didn't matter that he was overweight, not the best looking, or whatever, he was who he was and he was a good kid. However, not a month after he went off to college he started acting cocky; he'd call random girls "sexy" out of nowhere, he started talking like the stereotypical preppy kid, and so on. I hung out with him and his 'new friends' at one point, and when he was off doing something else his 'new friends' said that I was a lot cooler than they thought I'd be; they figured I'd be acting like my buddy was, being fake and whatnot. His old friends had started seeing him as weird and not at all 'him' as well. In the end, being someone he wasn't lost him old friends and didn't really gain him any new ones.
I learned very early on to be myself, and it's worked for me. I'm a huge nerd, an Eagle Scout, was in the Marching Band for six years (four of high school, two of college), played video games, watched anime, and so on. The first couple years of middle school I hated, but that was because I was hanging out with people I didn't like who didn't enjoy the same things I did and who I couldn't talk to about any of that sort of thing. Once I started hanging out with people I had things in common with I started enjoying things a lot more. The odd thing was that I kept hanging out with the other people, and started talking more about nerdy stuff with them, making random references and whatnot, and most of them didn't care in the slightest. A couple of them made fun of me for a bit, but that stopped when the others started leaving them out of stuff and whatnot because they were being dicks.
By the end of school I had friends who played football, a ton of friends in the band, friends in the stoner crowd (a surprising amount of them actually...), I hung out with a few cheerleaders on a regular basis, had my own group of friends who I went shooting with, and so on. They all knew who I was and appreciated me for being me, but I had to appreciate them for who they were too, which is where a lot of people seem to go wrong on this advice. I had to know when to go super-nerd and when to hold back a bit. There were friends I could do that with, and friends who would give me looks of confusion and then just go back to whatever else it was we were doing. I was always myself, but I had to appreciate my friends' interests when I spent time with them as much as they had to appreciate mine when they spent time with me. If I was hanging out with the jocks I avoided the Star Wars talks except in passing references (which some of them understood), and tended to play football or go to the gym more often than with my other friends. It's all a part of being yourself, but it's not all about you.
TL;DR:
Being yourself is always good advice, but you have to understand that some people won't appreciate you for doing so. Hang out with people that do. At the same time, you have to appreciate others for being themselves; don't force your thoughts on someone who appreciates who you are but doesn't like all the same things you do. Stick to the stuff you have in common, and build your friendship off of that.