In a fitting setup even he couldn’t have written, “Brooklyn Nine-Nine” co-creator Dan Goor was in the bathroom when he got the call last May that Fox had canceled the comedy after five seasons.

There had been rumblings about the fate of the show in the weeks prior but as Goor will tell you, there’s always talk like that these days unless a show is a mega hit. This time, though, Goor’s agent was cautioning that cancellation was a real probability: “It was the first time anyone had seriously ever used that word. It bonged around in my head.”

So when the call came in on Thursday, May 10 — a day and date Goor says he won’t soon forget — any usual phone protocols were out the window: “I was like, ‘You know what? I’m going to take this call. I’m not going to give them the courtesy of not being in the bathroom,” Goor says wryly with a bit of hindsight.

The oddball workplace comedy about a ragtag group of NYPD officers became another TV casualty unable to fend off the growing trends in TV’s modern era. It never pulled in stellar enough ratings — its fifth season averaged around 2.7 million viewers with delayed viewing over a week factored in — and Fox didn’t have an ownership stake in the show at a time when TV networks are pushing to own as much of their content as possible. (The comedy is owned and produced by Universal Television, the studio arm of the NBC television network.)


That was the story for 31 hours.

But by late Friday night, through a combination of network musical chairs and a Twitter uproar fueled by stunned fans — including the powerhouse likes of Guillermo del Toro, Lin-Manuel Miranda and Mark Hamill — “Brooklyn Nine-Nine” became the latest example of how a cancellation verdict in today’s TV isn’t necessarily the death knell it used to be.

Brooklyn Nine-Nine has given us fully human characters, beautiful, powerful, flawed, vulnerable, majestic... In whichever form, B99 must return. It will. And I will be there to watch. And, it is my hope that I hope that, this time, a lot more people do too. — Guillermo del Toro (@RealGDT) May 11, 2018

RENEW BROOKLYN NINE NINE

I ONLY WATCH LIKE 4 THINGS

THIS IS ONE OF THE THINGS#RenewB99 — Lin-Manuel Miranda (@Lin_Manuel) May 10, 2018


When it returns for its sixth season on Thursday, it will start its second life on a new network — one that originally passed on the comedy during its inception in 2012: NBC.

Real life or trippin’?

It’s now just after 11 a.m. on a day in early November and production is underway at the show’s precinct set at the CBS Studio Center lot in Studio City. One would be forgiven for thinking those fraught days in May had been a weird fever dream.

The show’s ensemble cast members — Andy Samberg, Melissa Fumero, Stephanie Beatriz, Terry Crews, Joe Lo Truglio, Andre Braugher, Dirk Blocker and Joel McKinnon Miller — are back at it, gathered in the precinct’s briefing room as their characters are informed about a new he said/she said case in what will be the show’s topical #MeToo episode. Beatriz, making her TV directorial debut, shuffles in and out of the scene as her character, Det. Rosa Diaz, after reviewing footage. All the while Samberg is coming up with ad-libs for the final beats of the scene — suffice to say, when you have the group talking about a broken male sex organ, things get colorful and absurd.

Off-camera, when the topic of the show’s summer fiasco is brought up, it’s clear that “Brooklyn Nine-Nine’s” boomerang from death is still a bundle of confusion, sadness and ultimate joy.


For Samberg, who is also an executive producer on the show, it resulted in some pretty funny text chains: “I have two texts in a row from people a few hours apart where they go, ‘Dude, I’m so sorry,’ to, ‘Never mind, congratulations.’”

“It was so surreal,” is how Crews, who plays Sgt. Terrance “Terry” Jeffords, describes the situation. “I’ve had a rental car stolen. That’s the only thing I can really compare it to. I was like: ‘What is happening? Is this real life or am I trippin’?’”

Now back in the swing of things, Fumero, who plays Sgt. Amy Santiago, says there are moments when it feels a bit like a do-over — pointing out how NBC’s social media team has been working overtime to promote the show’s move to the network. Adding to the display of confidence, Samberg is co-hosting Sunday’s Golden Globe Awards, alongside “Killing Eve’s” Sandra Oh, on the network.


“It’s almost like we’re a new show,” Fumero says, “but we’ve been doing it for so long. I’m definitely trying to check myself more to be just really present and enjoy it because who knows? Who knows how much longer we have?”

So what to do in the meantime?

“We want to make sure people who like the show still really like it,” Samberg says. “As far as ratings and all that other stuff, it’s completely out of our control. All we can do is show up for press, make the show as good as we possibly can and hope that everyone keeps watching it.”

Showrunner Dan Goor, left, poses for portraits with actor Andy Samberg, on a set for TV’s “Brooklyn Nine-Nine.” (Jay L. Clendenin / Los Angeles Times)


I have two texts in a row from people a few hours apart where they go, ‘Dude, I’m so sorry,’ to, ‘Never mind, congratulations.’ Andy Samberg, star and executive producer of “Brooklyn Nine-Nine”

Goor realizes there will be a lot of attention on how the show performs when it makes its NBC debut. But, he says, all he has control over is to keep making the show that fans rallied hard to save.

“I don’t wanna let people down,” he says. “What NBC has said, and what our philosophy has been, is just to keep doing what we’re doing, to make more of the same show. At the point at which we were picked up by NBC, we’d made 112 episodes. So we know how to make those shows and that’s what we’re continuing to do … we still have budgets and production realities, so it’s not like we could suddenly start shooting an episode in Australia … although, if Australia wants us to come there and pays for it, we’d love to.”

So yes, a #MeToo episode in keeping with the show’s practice of occasionally taking on topical issues with its brand of comedy is on the docket. Goor says the writers are also considering a refugee or undocumented episode.


But that’s not to say the show isn’t evolving. Chelsea Peretti, who plays caustic administrative assistant Gina Linetti, will not appear as a series regular in the new season. And the show will play outside the bounds of its traditional format, with an episode set entirely in a crime scene. And of course, the show also has the marriage between Amy and Jake to consider after last season’s wedding finale.

“We’re not really forcing anything with them,” Goor says. “They have the kinds of hiccups and conversations that newlyweds have. There’s not necessarily a special arc for them.”

Melissa Fumero as Amy Santiago, Andy Samberg as Jake Peralta in a scene from the new season of “Brooklyn Nine-Nine” (Vivian Zink/NBC)

Crime with a twist

Created by “Parks and Recreation” vets Mike Schur and Goor, “Brooklyn Nine-Nine” was developed as an antidote of sorts to the high-stakes cop dramas that are fixtures of prime-time. It centers on Samberg’s Det. Jake Peralta, a goof who is also really good at his job, but audiences have also connected with his co-workers, in all their nutty and eccentric glory.


It made its debut on Fox to decent ratings in fall 2013. In a show of confidence, the series nabbed the plum post-Super Bowl slot in its freshman outing — that season also yielded two Golden Globe awards (TV series, comedy or musical and actor in a comedy for Samberg).

The comedy, though, never really drew a broad audience and scheduling moves didn’t help its ratings woes. And with Fox making trims to its programming lineup this season, particularly among the live-action comedy ranks, to make room for its deal with the NFL for “Thursday Night Football” — gobbling up more than 30 hours of space on the network’s schedule — “Brooklyn Nine-Nine” got dumped.

But the thing about TV these days is there are plenty of other fish in the sea.

A TV show being canned by one network and rescued by another, while still rare, is not a new phenomenon. But the chances for a show beating death are at least more likely today with the increase in outlets clamoring for content and the premium on loyal audiences — particularly for streaming services that aren’t as reliant on ratings and traditional TV advertising as their linear network counterparts. (“Lucifer,” another Fox casualty from last season with a devoted fan base, is headed to Netflix later this year.)


For Goor, the most eye-opening aftershock of the whole ordeal was seeing fans galvanize. He always knew the show had fans — many of which watch episodes online — but, he says, when you’re on the air for a long time, you can lose sight of what exactly that means. The show’s cancellation elicited a strong reaction online and within two hours of the news both “Brooklyn Nine-Nine” and “Brooklyn 99” were trending on Twitter, with fans pushing for the show to be saved.

“There wasn’t an occasion for people to rally,” Goor says. “But with this occasion — getting canceled — so many people came forward, in America and all around the world, and it was really like the most heartwarming and wonderful part of the whole thing. My wife was like, ‘Best-case scenario, they don’t pick up the show, you get to see your family again, and you get to know people liked it.”

The set of TV’s “Brooklyn Nine-Nine,” which makes its debut on NBC this month after getting canned by Fox, at CBS Studio Center in Studio City. (Jay L. Clendenin / Los Angeles Times)

With this occasion — getting canceled — so many people came forward...it was really like the most heartwarming and wonderful part of the whole thing. Dan Goor, co-creator of “Brooklyn Nine-Nine”


But there was another best-case scenario: a reprieve. There was a scramble by Universal Television to find “Brooklyn Nine-Nine” another home, with Netflix, Hulu (its streaming home) and TBS (the basic cable home to the show’s reruns) in the mix as suitors. In the end, keeping the show all in the family and moving it to NBC was the more profitable move for the network and studio’s parent company, Comcast.

And it brings another Schur comedy into NBC’s fold, joining “The Good Place” and the upcoming “Abby’s.” It’s also a homecoming for Samberg, who was a cast member on “Saturday Night Live” for six seasons.

“It feels like this is a very familial piece for us,” says Tracey Pakosta, who co-heads the network’s scripted programming and helped develop the comedy. “Now that we have it, we’re so excited it’s here. It almost feels like it’s always been part of the network.”

Former NBC entertainment chief Bob Greenblatt, who left his perch at the network last fall, said at the time of the show’s save: “Ever since we sold this show to Fox I’ve regretted letting it get away, and it’s high time it came back to its rightful home.”


With it all said and done, Samberg says there’s no bitterness toward Fox.

“They were the ones who picked us up when NBC didn’t initially, so they gave us a great, huge initial push. They put us on after the Super Bowl and it was a really nice time there and the show exists because of that,” he says. “I have nothing bad to say.”

As for Goor, if there’s a lesson to be learned by the whole thing, and he says there are many, two spring easily to mind.

“Lesson 1, as Mike Schur has always said, our job is just to put down our head and make the best show we can make and not worry about the externals and those things take care of themselves when you make the best show you can make.”


And lesson 2?

“This was not a learning kind of lesson, but a verification of a lesson: More people might like your show or respond to your show or be moved by this thing that you’ve created than you know and so you can’t just judge your success by the metric of the overnight rating or whatever. There are deeper ways in which a show can be appreciated.”

So maybe in the grand scheme of things, that bathroom call wasn’t so terrible.

yvonne.villarreal@latimes.com


Twitter: @villarrealy