> Would we still expect such adamant evolutionary opposition to homosexuality if we took into account kin selection or that sexuality is a complex thing whose genetic component is likely to be influenced by many different genes

Yes. For example, a kin selection argument would need to assume that the number of additional surviving children produced by the homosexual's siblings was at least double the number of children forgone by the homosexual. This does not come anywhere close to being plausible. Things only get worse as the relationship becomes more distant.

> and it is possible that the set of genes that in some particular combinations give homosexuality give in other combinations heterosexuality plus some additional survival benefits that make it overall worthwhile to preserve those genes that can give homosexuality?

Is it possible? Sure; that's the sickle-cell anemia model. But as previously noted, what evidence we have tells us that homosexuality is already one of the least genetically-determined traits we're aware of.† And this theory shares the same problem as your first idea: the cost of homosexuality is so staggeringly high that we would never expect an offsetting benefit to be able to make up for it.

Suppose there is a genetic complex that arranges for various effects, and if everything goes wrong it causes homosexuality. Assume this failure occurs 5% of the time.

Our homosexual produces zero children. But a decline in relationship coeffiecients, which trashes the kin selection idea, is not a problem here: we're worried about comparisons of self-to-self, so as long as the expected number of children produced by this genetic complex is greater than otherwise, the complex can persist despite the occasional catastrophic failure.

In other words, we need 19 out of every 20 people expressing this genetic complex to have as many children as 20 baseline people would, an increase of 5.2%.

Compare this discussion of the inhabitants of Madagascar ( https://razib.substack.com/p/the-unreal-voyages-and-trials-o... ):

> Might adaptive selection pressures have reshaped the genomes of the Malagasy, altering the proportion of African and Asian ancestry and leaving a signature in their very DNA?

> A research group tested this hypothesis by sampling the genomes of 700 Malagasy from 257 villages across the island. What they immediately remarked on was a sharp drop in Asian ancestry across much of chromosome 1:

> The target of selection on chromosome 1 in this case is the Duffy locus; and specifically, the null allele that fails to produce the Duffy antigen is under selection. This gene is well known in population genetics because of a marked contrast in variants between African and non-African populations; most Africans are Duffy-negative while most non-Africans are Duffy-positive. Duffy-negative individuals lack the receptor used by the Plasmodium vivax malarial parasite to invade red blood cells, a deficit that confers malaria resistance on its bearer. In Malagasy populations today, the region of Chromosome 1 around Duffy spikes to over 90% African in local ancestry whereas across the rest of the genome, the African ancestry proportion hovers around only 60%. Researchers calculate that this change was driven by a selection coefficient on the order of 0.20.

> We can translate this into plain English as an individual carrying the Duffy-negative allele has 20% more surviving offspring than one who does not.

> This is a staggeringly powerful selection coefficient; very few genes have been subject to such drive in humans; indeed a coefficient of 0.01 or above is by convention usually considered strong selection.

So the effect on non-homosexual bearers of this gene complex would need to be very powerful indeed, far more powerful than almost any selective effect we know of in humans, just for the complex as a whole to break even on reproduction.

It would also have to be quite recent; over time the disastrous side effect would be separated from the beneficial primary effects. The primary effects would persist and the side effect would vanish.

† It's worth being careful here. Heterosexuality is strongly genetically determined. Homosexuality is not strongly genetically determined. As a result, it doesn't really mean anything to say that "sexual orientation is [or isn't] genetically determined" - different orientations are not the same by this metric, and so referring to an umbrella group doesn't make much sense.

By analogy, it should be easy to understand that people who have two arms are mostly that way for genetic reasons, while people with one arm are mostly that way for non-genetic reasons. Is "number of arms" genetically determined? Well, yes, but only when the number is two (or in fantastically exotic scenarios).