It might well be true that no judge would care about - or take seriously - the snippet of language you cite.
Lawsuits about contentious social and political issues and "culture war topics" have always been written with the understanding that they'll be read by the press and public. Providing quoteable snippets and soundbites has been "a thing" for a very long time.
One of the most famous trials about a "culture war" issue in US history - the so-called Scopes Monkey Trial of 1925 - was put on as an intentional publicity stunt. The Scopes trial, which was argued by two American attorneys who were already major celebrities when the trial began, created a media circus and garnered public attention on the scale of the Watergate hearings in the 1970s, the OJ Simpson double murder trial in the 1990s, and the more recent coutroom drama in which Johnny Depp and Amber Heard went head to head over which one of them was more abusive during their romance and marriage.
Also, other lawsuits, legal briefs and official complaints related to "gender identity" that have been lodged in courts and other kinds of judicial bodies in the the USA and other countries have contained lots of language meant to get press notice, generate publicity and drum up attention and sympathy from the general public for the plaintiffs .
Many of the decisions and dissenting opinions written by jurists in these cases have also contained passages and claims that others in the legal profession and the general public might look askance at and not take seriously. Or which might even prompt a lot of people to roll their eyes.
For example, these passages from the decision of the NY State judge who ruled on the Renee Richards in 1977:
When an individual such as plaintiff, a successful physician, a husband and father, finds it necessary for his own mental sanity to undergo a sex reassignment, the unfounded fears and misconceptions of defendants must give way to the overwhelming medical evidence that this person is now female.
Citing testimony given by John Money - the now-notorious psychologist at Johns Hopkins who along with California sexologist Robert Stoller came up with and popularized the term and concept of "gender identity" in the 1960s and 1970s - the judge said,
Dr. Richards is a female, i.e., external genital appearance is that of a female; her internal sex is that of a female who has been hysterectomized and ovariectomized; Dr. Richards is psychologically a woman; endocrinologically female; somatically (muscular tone, height, weight, breasts, physique) Dr. Richards is female and her muscular and fat composition has been transformed to that of a female; socially Dr. Richards is female; Dr. Richards' gonadal status is that of an ovariectomized female.
Dr. Money's professional conclusion... is that a person such as Dr. Renee Richards should be classified as female and for anyone in the medical or legal field to find otherwise is completely unjustified. Dr. Money also believes that Dr. Richards will have no unfair advantage when competing against other women.