All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad is His slave and messenger.
Marriage does not become void by such a statement. Actually, if he is truly a homosexual, it does not affect the validity of the marriage.
However, one should not joke with such a thing, it is an ugly word that the believer resents and feels disgusted when hearing it, let alone uttering it and claiming to be such a person, even if it were only a joke.
The Prophet used to joke, but he only said the truth.
For more benefit on lying when joking, please refer to Fatwa 394282.
Allah Knows best.