While this didn't necessarily have much impact at the time, one case that would later be dredged up by sociologists was John A.C Forbes-Sempill v The Hon. Ewan Forbes-Sempill.
In 1965, the Baronet Forbes of Craigievar died without heirs. So the baronetcy, under primogeniture, would go to his nearest living male relative - his brother Dr. Ewan Forbes-Sempill.

Thing is though, this brother was born as his
sister.

Effectively, he was born a woman, but after visiting Europe for consultations with medical experts (and being given what was probably testosterone treatment) he began presenting as a man. By the time he was 40, he had changed his birth certificate, based on the expert witness of three doctors that at birth (and biopsies indicating internal testicular tissue), an error had been made, and he was indeed a man. He even took out an advert in the local paper to say he was Ewan now; people didn't actually mind it seems.
Except for his cousin, who was now
second in line for the baronetcy, so took him to court. Biopsies of Ewan were taken that proved he had testicular tissue inside of him. The court's position was that you're either one sex or the other and if it's not obvious, it was down to the court to work out. And so -
Lord Hunter. then moved beyond all of the other authorities and held that he would follow the advice of Professor C N Armstrong of Newcastle Royal Infirmary and consider four criteria of sex; chromosomal, gonadal, phenotypical (the appearance of the genitals) and psychological. He admitted that the evidence of the first two was problematic, but with regard to the third: phenotypical he prioritised the evidence of Ewan's wife. He held that although the evidence was clear that Ewan's genitals were predominately female in appearance, the fact that his wife asserted that he was able to penetrate her satisfactorily and that she was able to reach orgasm was of far greater importance (ibid page 27, para:B). Supporting this was the fact that no evidence had been raised that Ewan could function as a female in intercourse. Finally as regards psychological sex, he held that there was overwhelming evidence that in Ewan's case he was male and along with the other features it was an "adminicle of evidence of some importance." (ibid page 28, para E). Thus Lord Hunter was able to find that Ewan was a "true hermaphrodite in whom the male characteristics predominate." Consequently, after referral to the then Home Secretary, Roy Jenkins, Ewan's succession to the baronetcy was confirmed.
Important to note here that under Scottish law it had already been established a couple years prior that a transgender person could not amend their birth certificate or legal sex, because their birth certificate was a legal document and their sex had been correctly identified. However, this created the legal concepts of criteria of sex.
Interesting this case actually strengthened the precedent - a couple of years later in Corbett v Corbett a man wanted to annul his marriage to his wife instead of have a divorce because she was trans, so the marriage didn't count because men can't get married, and the court upheld that on the basis of chromosomal, gonadal and genital sex, the wife was a man and so they were never married (they even ragged on the amhole - "When such a cavity has been constructed in a male, the difference between sexual intercourse using it, and anal or intra-crural intercourse is, in my judgment, to be measured in centimetres.") There are some suggestions that Dr Ewan might have collaborated with some of his friends in the medical profession to create some subterfuge and was actually just a plain ole trans man, but if that
was the case, then his ascension to the Baronetcy would have been overturned if he'd been found out.
The legal implications of trying to categorise intersex people were previously a lot more wide ranging (e.g. implications on pensions, or who they can marry, or things like military service). From the June 2003 copy of The Endocrinologist
The birth of an intersex child presents difficult medical and ethical issues to the attending physicians. Recently, these issues have become the subject of a debate among doctors, psychiatrists, ethicists, sociologists, historians, and intersex activists. Largely absent in these debates, however, is any discussion of the legal ramifications of the medical and psychological treatment of intersex infants. This paper explores the legal implications of early surgical intervention in the treatment of intersexuality. It provides a summary of the history of the management of intersexuality, describes the current approaches and premises underlying them that are being advocated for the treatment of intersex infants, and explores the legal implications of the dominant treatment model for the intersex child and for the medical treatment team. This paper concludes with a note of caution: the current dominant treatment protocol may impair the legal rights of the intersex child as well as lead to legal liability for the treating physicians.
This is where terminology like "assigned female at birth" come from. If we can see there's an idea that an infant may have been classified incorrectly (and indeed, subjected to genital-altering surgery to make them "conform" to their sex) it becomes necessary to develop language to discuss how they were
assigned one sex while biologically being ambiguous and closer to the
other sex, although a fair few intersex activists would argue that they are neither male or female, and should not be classified as either. Sometime they'll use terminology like "CAMAB" (coercively assigned male at birth).