One of the things that you can learn from most sitcom books is the idea that there should be some kind of harmony between your storylines. According to most authors, your storylines shouldn't be thematically and tonally too different from each other.
This kind of advice in most cases is pretty good. Indeed, there are instances where it's pretty obvious that a storyline doesn't fit in with the rest of the episode. The storyline in question feels out of place and makes the episode as a whole a mess.
One of the best examples of this kind of writing can be found in Modern Family's episode 5x12, 'Under Pressure'. This episode shows that sometimes you shouldn't try to put in a piece of a puzzle that won't fit in with the rest of the storylines.
In any case, this is the episode in which Alex Dunphy loses it - has an emotional breakdown due to stress - and ends up seeing a therapist. This storyline is probably the most seriously serious that the writers have tried - and failed - to integrate to an episode.
So there are a couple of fatal flaws in 'Under Pressure'. The biggest is likely that there are a total of five storylines in that same 22 minute episode - and all of them (besides Alex) are slapstick. This leads to the dramatic storyline sticking out like a sore thumb.
Good drama is always about elegance. How do you pull off an elegant episode when you have not only too many storylines, but you also have a storyline that radically differs from the others in every imaginable way?
I mean, Cam the gym teacher is dressed as a cowboy at school. Claire does her usual physical comedy. Jay and Phil smuggle alcohol. Jesse Eisenberg rapid talks with Mitchell. Luke and Manny have a crush on the same girl - and then we still have that, uhhuh, therapy storyline.
It makes no sense to have a really dramatic storyline in the episode when those other storylines don't support it. To make it even worse, Alex's story already climaxes in the very first scene. Everything that happens after that in her story is pretty much irrelevant.
Watching that Alex's storyline felt like watching a different show. When you watched it and compared to the rest of the episode, none of it made really sense. All her scenes were just thematically out of place and out of sync.
This was not good stuff at all - and yet - a lot of the critics liked it. Even though objectively speaking the script for the episode wasn't any good, it got even nominated for a writer's guild award. What were these people thinking?
In any case, this episode didn't work as a whole at all - and if you want to see another Modern Family episode that suffers from 'harmony' problems, check the recent 6x13 'Rash Decisions'. That one doesn't work either - but for different reasons.