From Bad Teacher to Bad Judge — that is the series transition Ryan Hansen is making this summer. The co-star of CBS’ midseason comedy Bad Teacher has been cast as the male lead opposite Kate Walsh in another single-camera comedy with a flawed woman at the center, NBC’s Bad Judge. It centers on the hard-living, sexually unapologetic Rebecca Wright (Walsh) whose life on the edge is constantly in balance as she also happens to be a judge in the criminal court system (watch the trailer below). Veronica Mars and Party Down alum Hansen, repped by Gersh and 3 Arts, will play Gary Boyd, Rebecca’s on-again, off-again sex buddy, a hacky-sack playing psychiatrist who makes all his money as an expert witness in the court system. This is a recasting of the role, which was played by Mather Zickel in the pilot.