It may not look like an ordinary cell with its 10 inches thick, unbreakable clear glass wall and lustrous stainless steel railings. However, it's still a dungeon, a torture chamber for some, maybe not in his kingdom, but still, it tortured York emotionally.
Surely his feet touched every inch of that cell's floor, pacing back and forth, pondering for possible countermeasures on his present predicaments. If not only for Thea, he can let his knights kill Tim and he will not be judged, but if he is right in his suspicion Thea is just in Nerie's body, then maybe there's something he can actually do to help her and have her body back. With those possibilities, he can't let anybody hurt her or destroy her body.
He may not get the idea over the probability of Thea being in Nerie's flesh, how she gets in there, and where could Nerie be, because as far as he remembered, they left Nerie unconscious. The same day that Thea's personality changes and becomes Tim.