The closest to a response I can come is with this recent reference [from Wikipedia]:
"
Author Summary
Sexual differentiation in eukaryotes is manifested in two fundamentally different ways. Unicellular species may have mating types where gametes are morphologically identical but can only mate with those expressing a different mating type than their own, while multicellular species such as plants and animals have male and female sexes or separate reproductive structures that produce sperm and eggs.
The relationship between mating types and sexes and whether or how an ancestral mating-type system could have evolved into a sexually dimorphic system are unknown.
In this study we investigated sex determination in the multicellular green alga Volvox carteri, a species with genetic sex determination; we established the relationship of V. carteri sexes to the mating types of its unicellular relative, Chlamydomonas reinhardtii. Theoretical work has suggested that sexual dimorphism could be acquired by linkage of gamete size-regulatory genes to an ancestral mating-type locus. Instead,
we found that a single ancestral mating locus gene, MID, evolved from its role in determining mating type in C. reinhardtii to determine either spermatogenesis or oogenesis in V. carteri. Our findings establish genetic and evolutionary continuity between the mating-type specification and sex determination pathways of unicellular and multicellular volvocine algae, and will enable a greater understanding of how a transcriptional regulator, MID, acquired control over a complex developmental pathway."
[
http://www.plosbiology.org/article/info:doi/10.1371/journal.pbio.1001904 ; my bold]
As I understand it, the question only applies to eukaryotes, since prokaryote sexual reproduction is not certain to involve full reproduction, mating types or (duh) organs. [
http://en.wikipedia.org/wiki/Sexual_reproduction ]
Given that, the referenced work "establish genetic and evolutionary continuity between the mating-type specification and sex determination pathways" and hence a deep root to "sexes or separate reproductive structures that produce sperm and eggs".
Maybe there are lineages that have evolved later exceptions, but those seem to be rare to say the least. That in itself may point to a difficulty, but I would like to see more research on the MID system to possibly tell us more.
Seems no one understand sex yet; it just happens. oo)