Sometimes when a person challenges a no contest clause and loses the challenge, courts will refuse to enforce the clause. Sometimes when a person challenges a no contest clause and wins the challenge, the court will enforce the clause anyway.
The difference between the two extremes is a matter of individual state law and what exactly is being challenged.
There are different rules in every state.
An estate planning attorney can advise you on wisdom of filing a challenge and the potential outcomes.
Reference: Wills, Trusts & Estates Prof Blog (Nov. 24, 2017) "Take It or Leave It: The Perilous Decision of Whether to Violate a No Contest Clause."