They might be lead to believe "if only we got married ... if only we had kids ... that will 'fix' it." Even straight couples who aren't in love fall into this trap.
I don't know how well real life imitates art, but a lot of films involving gay historical characters have a similar enough narrative I assume it has some grain of truth: The gay person would rather not be gay (it would be easier for them), and is told by society that it's a choice. Maybe they even have some small amount of feelings for the spouse or think they can "learn to love them." See Rustin 2023 as an example of the psychology in action.
> I'll go to my grave still very sad about the could-have-beens.
Sorry for that. Loss is one of the hardest, most confusing emotions. That lack of closure and the unknown is a truly awful feeling.