For years, ABC has been the home of the gently quirky family comedy, with each entry putting some new tilt on the nuclear unit: Modern Family, The Middle, Black-ish, The Goldbergs. Starting Wednesday, the latest addition to that crop of shows is The Real O’Neals, in which a seemingly perfect Catholic family in Chicago have their lives upturned by a series of shocking revelations in the pilot episode. This is a show dealing with darker issues than its network brethren, but presented in the same bouncy, upbeat style. It’s a weird clash of tone that shouldn’t really work, but somehow does.

The show was originally pitched as an autobiographical tale about the adolescent years of the famed columnist Dan Savage, though it changed enough in the development process to be considered more “loosely inspired” (Savage is listed as an executive producer). But the uneven pilot episode focuses mostly on the teen-aged Kenny (Noah Galvin), the family’s golden boy who is struggling to come out of the closet. His mother Eileen (Martha Plimpton) is overbearing and religious, his father Pat (Jay R. Ferguson) seems in a perpetual daze, and too much of the opening half-hour is dedicated to undermining their perfect family façade. But after that, The Real O’Neals seems to get a better handle on the more challenging material that helps it stand out from other usual sitcom fare.

The bombshells: Eileen and Pat are divorcing, Kenny’s older brother Jimmy (Matt Shively) confesses to an eating disorder, and his younger sister Shannon (Bebe Wood) is a kleptomaniac who’s questioning her faith in God. Still, the biggest news is Kenny coming out, and The Real O’Neals is smart to keep its focus on him in the following episodes, exploring the fascinating tension at the heart of a modern, but devout family. The Real O’Neals gently mocks the paradoxes of religion, though not with the same vitriol with which the Family Research Council attacked the show and demanded ABC cancel it before it even aired.

But the series isn’t provocative in the way such a reaction might suggest. Yes, a laid-back Jesus appears to Kenny in a vision at one point, but it seems more like a sign of Kenny’s own internal conflict as he comes into his own as a young man. Though the other family dramas play out as B-stories, judging from the early episodes, The Real O’Neals is really about coming out as a teenager, and what happens when your mother can’t reconcile that with her faith.

In her role as Eileen, Plimpton is excellent and helps keep the show together in its shaky early moments. She’s the toughest character, since pretty much everyone else in the family is a lovable dope of some sort. But Plimpton has excelled at playing hard-edged but sympathetic matriarchs for years, including in Raising Hope, one of the most criminally underrated family sitcoms of the last 10 years. There, she was a working-class oddball; here, she’s an overbearing type-A monster. In both cases, it’s hard as a viewer not to root for her.

Galvin, who has never worked in TV before, is a revelation as Noah. Ferguson, who was the adorably bearded Stan Rizzo on Mad Men, slides comfortably into the archetype of the goofy American dad, trying to navigate the idea of life without the woman he’s been married to for his whole adult life. Like The Middle or The Goldbergs, the show is a sunny, single-camera comedy with occasional flights of fancy, but like Black-ish, it’s not afraid to go after tougher issues in a funny way. (For example, the show’s third episode deftly deals with a gay slur in a way that’s neither overly dramatic or dismissive.)

These themes may seem ill-fitted to the sitcom’s conventional presentation, but the mismatch may serve a deeper purpose. The premise of every episode of The Real O’Neals I saw revolved around something serious (losing one’s virginity, school bullying, questioning the existence of God), but in each case, Eileen tried to hold the controversy at bay and present a friendly face to the public. Inevitably, something goes wrong, and everything she’s trying to hide spills out into view—an outcome made all the more meaningful because of the clash between form and content. With the recent departure of its head of programming, ABC may be changing, and these kinds of quietly subversive sitcoms might be on the way out. All the more reason, then, to see what more The Real O’Neals has left to offer.