The best example of miscommunication leading to heartbreak and humor would be Olivia's unrequited love for "Cesare," who is actually Viola in disguise. Olivia is infatuated with Cesare, thinking "he" is the epitome of all her romantic longings. She loves Cesare's unassuming, quiet nature more than the bold Duke Orsino Cesare was hired to represent. This desire is humorous because Cesare is not a real person, but a fabrication. Though Olivia's attentions make Viola comedically uncomfortable and frustrated (since she was sent to woo Olivia in Orsino's place), Viola pities Olivia, since her love is based on something that is not real and therefore, doomed to end in heartache.
Another good example of this phenomenon in Twelfth Night is Malvolio's desire to be with Olivia. There is less of an emphasis on melancholy here, since the snobby Malvolio is more interested in the boost to his social status that a union with Olivia would give him than any romantic yearning, but like Olivia's love for Cesare, this desire is also based on a misunderstanding. Malvolio is delivered a forged letter that supposedly confirms Olivia's feelings for him. Unfortunately for Malvolio, this letter only causes him to make a fool of himself in front of Olivia by convincing him that she will be impressed if he wears yellow stockings with crossed garters (which Olivia actually hates).