Getting On, which returns to HBO this Sunday night at 10:30 ET, is ostensibly a comedy. It’s billed as such and, to prove the point, the show’s second season has been paired with the return of Lisa Kudrow’s cartoonishly cringey The Comeback. Yes, the setting is problematic: The action, such as it is, occurs within the bleached-white halls of the underfunded, overburdened elder-care ward of a midsize Los Angeles hospital. But the three leads are veterans of Roseanne, Family Guy, and Reno 911!. And to help lighten the mood, Getting On’s two cameras swoop and zoom with the laconic, documentary style familiar from The Office — with the deadpan reaction shots to match.

So does it matter that I don’t find it particularly funny? The first three episodes of Season 2 didn’t make me laugh a single time. The jokes, as written by showrunners (and Big Love creators) Mark V. Olsen and Will Scheffer, don’t land so much as they splatter, spraying awkward bits of shame and sadness all over everyone involved. There’s noisy talk of anal fissures and vaginal abscesses. Living patients are nearly crushed in hospital beds and humiliated in hallways. When the air conditioning goes out in the ward, the dead ones are left to fester in the humidity. Getting On doesn’t just ask us to find the humor in an old woman’s unstoppable bowel movement, it wants us to laugh louder when, due to an equipment malfunction, she’s forced to bathe in it. This isn’t comedy. This is tragedy.

And that is exactly why, despite everything I just wrote, I have no qualms about recommending Getting On. All the nervous, inappropriate explosions — literal and otherwise — can’t obscure the show’s bruised, strangely dignified heart. It’s a series devoted to the uncomfortable aspects of existence, those that, despite our best efforts, we are unable to flush away: the literal blood and guts, the slow fade surrounded by burnouts. For that reason, I would challenge the initial assumption, my own included, that the characters are unpleasant. What they are is unfamiliar.

In direct contrast to nearly every other medical show on television, Dr. Jenna James, the ward’s supervising physician, isn’t heroic. She’s barely competent. As played by the brilliant Laurie Metcalf (who is now evincing a very different vision of professionalism on CBS’s not-at-all-bad The McCarthys), Dr. James is petty, craven, and dishonest. She unloads on her staff and neglects her patients. (This season we learn that she’s much happier when left alone to measure the anal-genital distances of mice.) Sweaty and stressed, Metcalf plays Dr. James like a walking pulled muscle; her tension suffers from hypertension.

The unhappiness cascades downward at the Billy Barnes Extended Care Unit. Whatever Dr. James dumps out tends to end up on Alex Borstein’s nurse Dawn, a prim martinet who tallies meaningless daily victories — a Hostess cupcake here, a shown-up colleague there — like Super Bowl scores. This season, Dawn’s intensely inappropriate relationship with her supervising nurse, Mel Rodriguez’s sexually conflicted Patsy de la Serda, plants its flag even higher up on Mount Yikes. (Dawn’s mention of a “water feature” in the house she plans for them to rent together nearly sends Patsy to the ER.) The menagerie of attending tight-asses and weirdos is amply filled out by Lindsey Kraft, Arrested Development’s Alia Shawkat, and, most memorably, Glee’s Jayma Mays as a Stepford executive eager to profit from death.

What grounds Getting On, even as it flirts with extremity, is Niecy Nash as nurse Didi Ortley. With her face stripped of makeup and her acting stripped of all affect, she delivers a beautiful and nuanced performance that’s worth watching even when the show around her isn’t. Didi isn’t a saint, nor is she a screwup like Dawn. The most extraordinary thing about Didi is her patience. Despite buckets of abuse, malfunctioning equipment, and a salary that doesn’t even qualify as paltry, Didi goes about her business, somehow maintaining her pride in a circumstance determined, every day, to snatch it from her. I raved about Nash last year, but it bears mentioning again. It’s a Dylan-goes-acoustic moment for her career, and I hope the producers of every drama on TV are paying attention.

When Getting On truly shines is when it shrugs off the wink-wink-gasp rhythms of the comedy it wants to be and relaxes into the tough, uncompromising series it actually is. Nash is sublime when interacting with the various patients and guest stars who wander unhappily into the ward. TV veteran Jean Smart is luminous and raw as a recent widow stuck caring for her declining mother-in-law. And the great Betty Buckley is tremendous as Dottie, a flinty alcoholic dead set on having another drink even if it’s likely to kill her.

That Dottie’s story line is ultimately played for shock is hugely disappointing and speaks to the tonal disconnect at the heart of Getting On. It often feels as if Olsen and Scheffer are unaware of what works and what doesn’t on their own show. But just by introducing Dottie in the first place, and giving her 30 minutes to be fully alive, with all the glorious contradictions that entails — vivacious and sickly, proud and pathetic — the two are doing something rare and right. Caring for the elderly is something we all want to applaud but none of us actually want to do. So there’s something to be said for a series that sets up camp right in the fluid-clogged heart of that contradiction. I don’t particularly like the way Getting On makes me cringe. But I absolutely love that the show never, ever does.