That's where you're going wrong... actors in big budget hollywood films are NOT just there to act the role, they're there to sell the film.
Their job is to make you want to go and see the film, make you think about the actor, fantasise about the actor...
And the rather backwards old fashioned thinking is that if you, a woman, believe the leading man in a straight role to be gay.. you won't do that, you won't believe, you won't dream, you won't pay up to see the movie.
Of course if its a gay role... and you believe he really is gay.. same thing.
If its a gay role and you believe he is straight... then you can still do all that and so.. still go to see the film.
Stupid, horrible attitudes, but... thats how those movie executive money men think.
Of course there is some variation, it depends on the actor, the roles they are likely to take, where in their career they are..
Elliot Page is young, tends to appeal to a younger generation, so the trans thing is not a big deal for the roles he'd take on, therefore it hasn't been an issue, hurrah, Hollywood looks inclusive and marvellous.
Leo on the other hand has had a solid heterosexual screen appeal from pretty much day 1 - that would be a big deal.
Jim Parsons came out fairly early on, but then his break out role as Sheldon wasn't a leading man sexy screen appeal role, so that didn't matter, and the market was if not actual nerds... generally younger generation on the nerdier side of the scale.
Acting is a fickle, shallow world!