What if a chapter is incredibly depressive, dark, with intense language. And the next reads almost like a dialogue from a Seth MacFarlane comedy. Or even better, what if the tone switches occur between scenes. I think most books I've read maintained a consistent mood, even if the characters emotions were flipping. So what do you think about breaking this rule?
You could get away with drastically different tones if you had two different POV narrators. If one is Tina Fey and the other is Sylvia Plath, they will of course see the world differently. The contrast will probably make your book lean more towards humor/dark humor/satire, so as long as you're okay with that, give it a shot.
This is not the same as a lighter passage in a bleak book or a dramatic scene in a funny book. We're talking about entirely different tone, vocabulary, and imagery.
I would not have a third-person limited or omniscient narrative voice which changes from Fey to Plath without explanation. The whiplash would be off-putting.
You don't want to break the reader's immersion.
With your writing, you build the reader's identification with your characters and his expectations about the future progress of the story. If your characters suddenly act out of character, they become unbelievable. If you story progresses in a random fashion, your readers will be confused.
Sure, life isn't always the same, and in long novels the characters often are granted a respite from their toil, so that they can tell campfire tales or make love, but these interludes have meaning in the overall storyline, they fit the internal logic of the fictional world, and they usually don't completely fall out of the rest of the narrative stylistically.
On the other hand, there are books that break all the rules and do whatever they want. Apparently there are people who buy and read them. I cannot say much on these, as I cannot bring myself to read them, they annoy me so much. If you like them, you should ignore my advice and probably know much better, what you want to do.
In Shakespeare's Othello, Othello's speech often changes tone between scenes. He often sees himself as uncivilized however his tough is quite the contrary. However, in some scenes his language becomes more "brutal".
This was just an example, I think that changing the tone of dialogue in a character can both allow the reader to identify the mood of a situation. For example, if a character who is always optimistic suddenly starts contemplating his life and mortality it would allow the reader to see that this character is in a perhaps "grave" circumstance.
This question allows for a lot of opinion and this is just mine, you may find some people who think that changing a characters tone is "inconsistent" with the story.
If you switch narrative tone, it will distance the reader and make it harder for him or her to achieve suspension of disbelief. If you are writing a post-modernist novel, or a post-post-modernist novel (say, a fable about life in a you-tube-saturated short-attention-span society), this might be a good thing. Otherwise, it is probably something to avoid.