If you’re gonna put diversity in your book’s lore, it should never be an afterthought with no explicit mention in the book. It might as well not be there in the first place if you do. This is especially a horrible idea if the character you’re revealing to be gay has been killed off before you revealed it.