Patricia Heaton has become the queen of comedy on television over her two-decade career. She won multiple Emmys for her nine-season role as Debra Barone on “Everybody Loves Raymond,” and then hit pay dirt with another nine-season hit “The Middle.” In both, she played wives and mothers to whom America could relate, and she remained a reliable source of clean family entertainment.

Heaton is back this season in the new CBS sitcom “Carol’s Second Act,” but this time, the magic isn’t quite there. Wisely, Heaton tries to mix things up a bit. The show is more of a workplace sitcom, so instead of focusing on domestic life, Heaton’s new character Carol Kinney is a woman in her mid-50s who has decided — after an unseen husband leaves her to “find himself” — to retire from teaching and pursue her real dream of becoming a doctor. 

One the one hand, this is an intriguing concept. It touches on issues that millions of people can relate to: mid-life crises, dealing with divorce, late-life career changes — but it keeps the focus so much on the often-funny jokes that very little of it resonates in a way that makes viewers root for the characters. 

The pilot episode finds Carol as an intern at the fictional Loyola Memorial Hospital in Los Angeles. She alternates between an overly giddy new doctor and a calming, wise presence amongst her much younger fellow interns. 

Those interns — a woman named Lexi (Sabrina Jalees), who is the fist in her family to go to college, much less med school; an initially overconfident and surprisingly sensitive man named Daniel (Jean-Luc Bilodeau); and an overly PC man named Caleb (Lucas Neff), who fills the goofy doofus role in the series — are initially rivals. 

But within the pilot, written by Emily Halpern and Sarah Haskins, who keep it refreshingly clean and smart, the relationships quickly gel into friendly shenanigans. The funny foursome of interns play well against their two supervisors: the tough as nails, no-nonsense chief intern Dr. Maya Jacobs (Ito Aghayere), and the goofy senior doctor of the intern program, Dr. Frost (Kyle McLachlan, in a surprisingly strong change of pace from a career in mostly serious and even nefarious roles). 

Aside from introducing the characters, the main plot involves a male patient who has been suffering from migraines and thinks they’re from a car accident. But Carol notices some unusual details of his condition and winds up providing a surprising diagnosis that lends the show some touching moments, played in a way that is rare in studio-audience sitcoms.

There’s some fun physical comedy mixed in, with a great slapstick moment that reveals a side we haven’t seen from Heaton before. However, the show feels somewhat claustrophobic, being set in just three or four rooms of a hospital, and the second and third episodes never changed the settings up either, missing out on all sorts of rich possibilities about the private lives of Carol and her coworkers.

Both of those episodes also featured main stories in which a patient had a mysterious ailment that Carol has a unique take on. Her opinions don’t necessarily solve the case, but spin the team’s efforts in a direction that yields surprising results.

“Carol’s Second Act” positively reminds viewers that the medical profession is a noble one, with people who want to help others and save lives. Its plots about patients with unusual cases are smartly written and have interesting twists, which is a rare achievement in the cookie-cutter world of most sitcoms, and the jokes mostly steer clear of sexual or otherwise crude humor.

However, there is one major red flag, particularly for family audiences: Although it doesn’t seem necessary to its plot or overall message, the show draws attention in passing to the same-sex attraction of one of the characters in each of the first three episodes. It makes one wonder why this is a character trait at all on a sitcom marketed to families.

It is refreshing to see a show that values the wisdom of hard-working, middle-aged mothers while not feeling preachy. Heaton’s comic timing is as fresh and sparky as ever, but the show’s narrow focus just doesn’t give her much to work with here.

That’s a shame, because aside from some funny banter with her adult daughter, who works as a pharmaceutical rep at the hospital, Carol’s private life is never shown and barely discussed. Her divorce is barely addressed other than as a plot point, thus making it a glibly handled angle that provides no insight, complexity, or even empathy for her.

Considering the hardships that divorce brings to those who suffer through it and their loved ones, “Carol’s Second Act” has left a rich source of meaningful material untapped. That shallow approach likely means that this is one show that won’t make it to the third act.