In mainstream literature, this is not a common theme as it goes against basic moral and ethical norms. However, in some extremely rare and perhaps shock - value - seeking fringe works, there might be some allusions, but these are not widely accepted or promoted. The judicial system is typically associated with fairness, justice in a more general and proper sense, not this sort of inappropriate and cruel concept.
Fiction usually aims to explore human nature, society, and justice in a more acceptable and relatable way. A topic like 'judicial genital punishment' is so extreme and unethical that it is not likely to be a major theme in fictional stories. Writers are more likely to focus on things like solving crimes, the struggle for justice within the framework of the law, and the moral dilemmas that are more in line with common values.