Who would someone actually believe this is something you should never say? Plenty of relationships and situations would allow a joke like that. If the person feels shame about being gay, it can break the tension. If the person says it matter of factly, if the relationship involves enough playful ribbing, if the group was already super queer, it would be fine.
Coming out doesn't need to be a super serious moment, especially since you usually need to come out on multiple occasions to different people. It's tiring to never have fun.
I've considered coming out as gay on April 1st so that I've come out as L, G, B and T and collect the whole set, but even if it would be actually funny in my case, it's still in questionable taste.