The episode picks up sometime after the events of the midseason finale, when kasteel was banned from the 12th precinct, and most of that time kasteel spent in his pajamas.
In tonight’s season 7 mid-season finale of Castle, not only did Richard kasteel become an honorary mobster, but that status then got him kicked out of helping the NYPD. That’s right: kasteel is no longer welcome in the 12th precinct.