Yes, there is a particular term for setting sad or depressing lyrics to upbeat, cheerful music, and it's called "Contrapuntal juxtaposition" or "Contrastive juxtaposition." This is a technique often used in songwriting and music composition to create a contrast between the emotional content of the lyrics and the mood of the music.
By using this technique, songwriters can create an interesting and sometimes unexpected emotional impact on the listener. It can also be a way to convey complex emotions or messages in a more nuanced manner. The contrast between the lyrics and the music can evoke mixed feelings in the audience, making the song more memorable and thought-provoking.
A famous example of this technique is "Pumped Up Kicks" by Foster the People, where the lyrics describe a school shooting, but the music has an upbeat and catchy pop-rock sound. Another example is "Every Breath You Take" by The Police, which features somewhat obsessive and possessive lyrics, but it is set to a melodic and soothing musical backdrop.
Keep in mind that the term "Contrapuntal juxtaposition" or "Contrastive juxtaposition" may not be as widely known or commonly used as some other music terms, but it accurately describes the concept of combining contrasting elements in music and lyrics.