I wouldn’t call it homophobia. Hollywood has no problem with homosexuality. But that doesn’t mean an openly gay actor is going to be seen as the most potentially lucrative for certain roles. For example, with romcoms, part of the popularity comes from a female audience that likes inserting themselves into the fantasy. Would they be as willing to show up to the box office if the romantic lead were openly gay? Seems doubtful.
You are quite correct. If there is any sort of "homophobia" in Hollyweird, it is coming from producers and studio heads who don't want to take a chance on a gay dude as a romantic lead. I think some actors are probably regretting being so "out there" now.
One such guy is Welsh actor Luke Evans. He played Bard in the Hobbit films and Dracula in Dracula Untold. He's a good-looking guy and had great potential as a romantic leading man. In the 2019 version of Midway he played Wade McCluskey and came off just like a manly Hollywood actor of the 40's. In his younger days he loved to talk about being gay. He would have been alright had he stayed a UK stage actor because so many of them are gay. But once he showed romantic movie appeal, he probably regretted being so "out" and does not mention it much any more.
Rock Hudson was a perfect example. Had he "come out" early in his career he'd have lost much of his fan base, young women.
Exactly why Rock Hudson kept his gayness undercover for decades.