A creepy court crackpot who stalked two judges was ordered Thursday to stay away from a Brooklyn courthouse — but he might not have gotten the message.

After Christopher Ransom, 22, was slapped with a restraining order that forbids him from coming anywhere near the courtroom, he had the nerve to ask about jury duty.

“What are the terms if I get called for jury duty,” Ransom asked after he was sentenced to 60 days, which he’s already served, for violating a previous order he received after pleading guilty to criminal impersonation for faking internships with judges to obtain a courthouse pass.

“If I have this order of protection, what am I supposed to do about that. I might get in trouble for not reporting for jury duty. It’s in this building and I’m not supposed to come here. So what am I supposed to do?”

Ransom could have gotten up to a year in jail on the impersonation charge, but a judge agreed with the stalking victims that Ransom would be better served by psychiatric treatment.

“At this time, and I repeat at this time, jail is not the help he needs,” Supreme Court Justice Patricia DiMango, one of Ransom’s stalking victims, said in a victim’s impact statement.

“Probation with ongoing psychiatric treatment ensures he receives the help he truly deserves and needs.”

The order of protection extends to Justice Ruth Shillingford who was also stalked by the courtroom con.

The sentence was handed down by Judge Gene Lopez, who came in from Queens Supreme Court to avoid any conflict of interest with the involved Brooklyn judges.

On April 8, Ransom used a photocopy of the confiscated ID from his terminated internship to try to get back inside Brooklyn Supreme Court, but he was caught and arrested for violating the orders of protection, court documents state.