This is interesting, but your analysis sort of depends upon the idea that homosexuals are exclusively males attracted to other males.
But there are lesbians. Homosexuality exists among both males and females. So your proposed biological basis for homosexuality doesn’t fit the observed existence of both male and female homosexuals.
Furthermore, how do we avoid calling this a “dysfunction” — i.e,. an abnormality or deformity or disease?
The factors I cited are not exclusive to males.
Not mentioned are possible reasons for homosexuals to exist in the first place, among the strongest reasons being natural selection elimination from the gene pool, of not just homosexuals, but of others that should be eliminated by luring them away from couples that should breed.
This might reach beyond homosexuality, to other things such as prostitution, and women who engage in post-menopausal sex with younger men.