"It's bad to breathe molecule #346739572384143 of oxygen, because if everyone would breathe molecule #346739572384143 of oxygen, we'd all share the same lungs and be some kind of Siamese octbillionuplets"
The categorical imperative says: decide rules that would be good if everybody followed them, and then follow those rules. "Everyone should be homosexual" seems to be a bad rule, but "everyone should have sex with whatever gender they like" seems to be a good rule, so you should follow it. It doesn't say you shouldn't be homosexual because it would be bad if everyone was homosexual.
That would be more akin to say that everyone must sleep with the first lady, so no it's not the same thing at all. What I'm stating is more to decide whether you should breath a gas or a liquid.
> The categorical imperative says: decide rules that would be good if everybody followed them
No, it's a measure to decide which rules should can be considered good in the first place.
> "everyone should have sex with whatever gender they like"
If you think this a good rule, then you should also be content, with a world where everyone is homosexual. Are you?
> It doesn't say you shouldn't be homosexual because it would be bad if everyone was homosexual.
That's exactly what it says. It builds on the fact, that rules that only apply for some people, are generally considered to be unjust. If a rule is acceptable, it has to be still acceptable, if everyone would use it in the same direction. If you don't like that result, then either the rule is bad, or you accept different standards for different people. ("Rules for thee, but not for me.")