Nathan Fillion and Stana Katic Nathan Fillion and Stana Katic

[WARNING: The following story contains spoilers from Monday's Castle. Read at your own risk.]

Castle's midseason finale may have been a Christmas episode, but there wasn't a lot of holiday cheer.

After an ER doctor is shot on the street by a man in a Santa suit, Castle (Nathan Fillion) and Beckett (Stana Katic) quickly realize the victim may have been a doctor for the mob. During the twisty tale, Castle (somewhat against his will) becomes a blood brother with mob boss Dino Scarpella (Paul Ben-Victor), who urges (threatens?) Castle to help prove the innocence of the key suspect, Christopher Carlucci (Vincent Spano).

The Castle Wedding: How did Castle and Beckett say "I do"?

Fortunately for Castle, he and Beckett eventually prove that the real killer is Detective McBride (Larry Poindexter), a veteran cop on the organized crime beat. However, when McBride is killed by unknown assailants while being transported, the D.A. becomes suspicious of Castle's connection to the mob. Captain Gates (Penny Johnson Jerald) breaks the bad news to Castle just before the holiday party.

"It doesn't look good , especially for you," Gates said. "The D.A. spoke to the mayor and you are no longer permitted to work with the NYPD." Although he took his lumps in stride, Castle couldn't bring himself to tell the Beckett — who had just completed her first ever poem for the CastleFamily Christmas Card — the truth.

But that wasn't the only lump of coal the episode delivered. After Lanie (Tamala Jones) and Esposito (Jon Huertas) spend much of the episode pretending to be engaged to impress Lanie's visiting parents, the duo ultimately decides it's time for their on-again-off-again fling to be off again. "Being fake engaged to you made me realize how great we are together," Esposito says. "But not like your parents are, or Castle and Beckett. ... I'm crazy about you , but not in that way. You deserve what they have."

Check out the weirdest holiday TV specials

So are Lanie and Esposito done for good? And what does Castle's barring from the NYPD mean for his and Beckett's working relationship? TVGuide.com chatted to The Grinch executive producer David Amann to find out what's ahead when the show resumes in January.

You told us a game-changer was coming and now Castle's been booted from working with the NYPD! What inspired you to take the story in that direction?
David Amann:
 We thought it would give us some opportunities to upset the apple cart a little bit in terms of the Castle-Beckett professional relationship. We were looking for an interesting way to have Castle get into trouble. He kind of operated outside the lines in Episode 10, so we felt that like it was justified that he would be punished for that. 

Captain Gates doesn't seem to necessarily believe
 Castle did anything wrong, right? 
Amann: I think it's an unintended consequence. I agree with you — I don't think Gates is necessarily onboard with the severity of this [punishment] but she understands. And I think Castle does too; he takes it like a man. But that is not to say that he will not continue to try to figure out a way to work with Beckett. Castle is very invested in Beckett both personally and professionally and wants to continue to work with her. So, he is going to try to finagle his way into continuing to do that, which is going to offer some fun moving forward in January.

How so?
Amann:
 When we come back for episode 11, a couple of months will have passed. Things have found a different kind of equilibrium. Castle's not at the precinct, but he's writing and keeping busy, and Beckett and everybody's kind of acclimated to his absence. Just as they have acclimated to his absence, suddenly he appears at the scene having acquired his private investigator's license. He presents himself as a private investigator with the sole intent and purpose of getting back into the 12th Precinct through the back door. That's not going to go his way but that's not going to stop him from trying.

In trying, could he make matters worse for himself?
Amann:
 Yes, it could make matters worse. He has to watch himself. There's a line that he has to walk, and I would say in the first episode back, he does not walk it very well.

Ho, ho, hot! Check out sexy celebrity Santas!

You said Beckett & Co. acclimate to not having
 Castle around the precinct. Does that put any strain on Castle and Beckett's personal relationship?
Amann:
 I think they both are missing the work relationship, but what Beckett doesn't know is during this time Castle has been working hard on trying to getting his P.I. license. Castle is actually focused on solving that problem, unbeknownst to her. I think Beckett might be a little bit miffed thatCastle did not tell her anything about this. But beyond that, she understands the reason. It's a source of fun between the two characters more than it is a source of tension.

I should add that in all these episodes, we didn't conceive them as Castle has one case and Becket has the other. They intersect, one way or another. In a way, Castle winds up working with her in these episodes one way or another, but just not in the way that he was before. I wouldn't want the audience thinking we're not going to see Castle and Beckett together working anymore because he is able to sort of weasel his way into working with her by hook or by crook.

Is Castle any good as a P.I.?
Amann: He's not really great at it initially. He's a novice. As much investigating as he's done, he has not really done it like this before.

So, we shouldn't expect this to become a permanent arrangement?
Amann: It's certainly not going to be permanent. I think his aspiration is for him to earn his way back into the 12th Precinct. I don't think that will be particularly easy, but I also don't think it's going to be impossible.

This episode also provided some resolution to the Lanie-Esposito relationship. Why did you choose to have them end it?
Amann:
 Their relationship has been a bit of an on-again, off-again sort of thing over the last couple of seasons, and I think it's largely a function that they care about each other deeply but the timing never quite seems to be right for them. I don't think we rule out the idea that the stars might align and that they find each other again, but in the near-term, we think that we'll be exploring a little bit of Esposito's life as a single man. There's some enjoyable stuff coming the audience's way in connection with that.

Finally, will Castle's new mob connection play a part in the back half of the season? 
Amann: [Castle] is offered a favor at the end of Episode 10. I think that is a favor that he may well collect on before the season is over.

Castle returns with new episodes in January. What did you think of the midseason finale?

On the set of The Flash: Is Harrison Wells good or evil? Cast weighs in!