I feel like I've experienced that before, but I am not sure I can name an anime in specific that was guilty of this. I just feel like there was an annoying character joking while very serious situations were going on that would detract from them and their jokes weren't funny.