I think you're confusing stereotypes with real life, and characters for real people. Real people are always going to have more depth than a character because they've lived longer and had more experienced shape them, so they have so many more dimensions than fiction. I'd we willing to bet that there's no one on earth that has no sense of humour. It might not align with yours, but they do have one. Also, a lot of anime is not set in realistic Japan, but "anime Japan" where social rules are different (hence why people who only know Japan from anime get such a culture shock when they're there).
It'd be like asking why English people are so loud and dramatic and sometimes crude in popular BBC shows like Sherlock or Doctor Who when "English people are known to be prim and proper and stoic"... Like yeah there is a culture of "push down the negative feelings until you burst" but also we're very loud, very annoying people.
TL;DR Japanese people are multifacetted and can do both expressiveness and respectful deference to others, don't base your entire view of Japanese people on anime o'r how they relate to anime.