“Survivor” contestant Jeff Varner learned the hard way that outing someone as queer or transgender often doesn’t end well.

Varner, a North Carolina-based realtor and former news anchor who is gay himself, revealed that fellow contestant Zeke Smith is transgender during this week’s episode of the long-running reality series. Other competitors and viewers alike were shocked, and Varner was eliminated from season 34 of the competition quickly thereafter. (Notably, both contestants had been on the series before — the current iteration, dubbed “Game Changers,” features competitors from past seasons.)

On Twitter, Varner issued an apology, saying that “outing someone is assault.” Smith, a 29-year-old asset manager from Brooklyn, told People that he didn’t want to be known as the show’s first transgender contestant. “I just wanted to be known for my game,” he told the magazine. (Smith and Varner did not return requests for comment.)

Zeke Smith from ”Survivor: Game Changers” on being outed as transgender: “I just wanted to be known for my game.” Timothy Kuratek/CBS Entertainment

Survivor’s Fijian location may not resemble a typical workplace, but the same rules should apply. And in this case, that means never disclosing another co-worker’s sexual orientation or gender identity, workplace experts say. At the same time, it’s unlikely that Varner would face any litigation over his transgression. “It’s not illegal to out someone in the workplace,” said Darnley Stewart, an employment attorney with the law firm Outten & Golden in New York.

That doesn’t mean employees who out each other will go scot-free. Twenty states and the District of Columbia have employment non-discrimination laws that cover sexual orientation and gender identity. Another two states — Wisconsin and New Hampshire — have laws that protect only sexual orientation. In these states, if outing a fellow employee leads to them facing a more hostile work environment, that person could have grounds for a lawsuit, Stewart said.

Granted, most states do not have protections for LGBT individuals from workplace discrimination on the books. And in late March, President Trump issued an executive order that rescinded a component of a previous order from the Obama administration that banned federal contractors from discriminating against LGBT employees based on their orientation or identity.

But recently, the tides have also started to shift in LGBT workers’ favor at the federal level. Earlier this month, the Seventh Circuit Court of Appeals issued a full-court ruling that Title VII of the 1964 Civil Rights Act, which bars sex discrimination, applies to sexual orientation. (The U.S. Equal Employment Opportunity Commission adopted this stance in 2015.)

The case may now head to the Supreme Court, where its fate is less clear. “It’s a little uncertain now with the new Supreme Court justice,” Stewart said referring to Neil Gorsuch. “It seems to be a fairly sensible decision, and given the court’s decision on same-sex marriage I don’t see why it shouldn’t prevail at the Supreme Court as well.”

Of course, people shouldn’t just respect others’ privacy when it comes to their LGBT identities just for fear of being sued. Studies have shown that workplace discrimination is linked with depression and other mental health issues. And recent surveys indicate that despite the progress made on issues like same-sex marriage, LGBT people feel less comfortable being out in the workplace.

A study conducted by Out Now, an LGBT consulting firm based in the Netherlands, found that the share of LGBT individuals in the U.S. who were out to everyone at work dropped from 44% in 2010 to 38% in 2015. The U.S. was the only place in the multi-country study where this metric declined. One possible explanation for that figure: nearly half of LGBT U.S. workers reported having heard something homophobic in the workplace in the past year.

See also:Apple’s Tim Cook on being gay: ‘I have the skin of a rhinoceros’

Transgender people face even more pronounced difficulties in the workplace. More than a quarter of transgender individuals said they have lost their job because of their gender identity, according to a 2009 report from the National Center for Transgender Equality and the National Gay and Lesbian Task Force. And a staggering 97% of transgender people reported being mistreated at work, including being denied access to an appropriate bathroom or being removed from contact with clients.

LGBT employees feeling comfortable being open in the workplace has real ramifications for businesses. Employees who were out to everyone they worked with were 11% more likely to stay in their job than those who were out to nobody in the workplace. And losing LGBT employees who feel unwelcome adds up: A company in the U.S. with 50,000 workers could spend anywhere from $633,000 to $4.7 million to re-staff and retrain these positions, according to Out Now. “A corporation can save simply by helping their LGBT staff come out to their colleagues,” said Ian Johnson, chief executive of Out Now.