I imagine it would depend on the contract itself, but IANAL. It is true that a contract that specifies a party engage in something illegal is unenforceable, for what that is worth.
I’d assume the contract isn’t “Don’t tell anyone I raped you” but rather not to talk about any sexual encounters between them. Which could then be framed as not wanting his private life and infidelities (even if know to his wife) becoming public chatter despite their (as he’d argue) consensual nature.
Where would one begin?

So he’s conceding that she’s telling the truth?
They had an agreement, he paid, she didn’t hold up her end. If she wanted the truth to be spoken she should not have accepted money for silence.
Alternate theory: NDAs are a pox on humanity, with little to no legitimate purpose. The more people break them, the better.
+1
Discourse!!!oneeleven

Alternate theory: NDAs are a pox on humanity, with little to no legitimate purpose. The more people break them, the better.
An NDA is signed before the malfeasance, I was not aware someone could be in anyway compelled to sign one after the fact. But then I don’t know the particulars of the case, just enough to know that contesting breach of contract isn’t admitting wrongdoing and why would it.
Moraliy and legality are, as often happens, two different things here. Morally, Gaiman raped a woman, bought her silence and is now making things worse for himself. Legally, she signed an NDA agreeing to receive money in exchange for not saying anythug. She violated the terms of that agreement. Gaiman is legally entitled to get the money back. Depending on the specific conditions of the NDA, he may be legally entitled to more money.
Bill Cosby made an agreement with a DA that his testimony would not be used as evidence against him. He then confessed to drugging and raping several women. When a new DA was elected, he prosecuted Cosby on that testimony and got a conviction. That conviction was overturned. The agreement with the prior DA meant that the evidence used to convict Cosby was inadmissable. There was no moral or factual question of his guilt. He had confessed on the record. Legally, his guilt could not be proven and he was released.

Alternate theory: NDAs are a pox on humanity, with little to no legitimate purpose. The more people break them, the better.
I agree with regards to that type of NDA. But my work involves routinely dealing with confidential information. Every job I’ve taken in the last (mumble mumble) years has required signing a NDA along the lines of, “i won’t give away proprietary info about the clients I’ll be working with, or about my employer”. I’ve never run into anything illegal (in fact, some of those NDAs specifically have an exemption for informing authorities about illegal activities) but I’ve run into lots of confidential info. People’s names, SSNs, and medical conditions. The company’s proprietary pricing algorithm. Details of legal negotiations.
I’m not certain how you cleanly separate appropriate from inappropriate NDAs.
I’m happy to see that at least Gaiman is suffering financially. Ick. How disturbing that he did that.
I was under the impression that there two NDAs between Gaiman and Wallner: A typical one that was signed at the time of employment (e.g. don’t gossip about the Gaiman) and a second one dealing with the hush-money (take $275k and don’t say anything). If she had seen illegal activity while working for Gaiman, like he was dealing drugs, and she reported him for that, I don’t think the NDA would hold up. But I think the second NDA is enforceable if she takes the money and then talks about what happened. She agreed to take the money to stay quiet. If she didn’t want to stay quiet, then she should not have taken the money. The first kind of NDA is a poorly defined blanket agreement and something which maybe should go away in some situations. The second NDA is really more like a contract between two people with specific points of agreement.

The first kind of NDA is a poorly defined blanket agreement and something which maybe should go away in some situations.
I’m the opposite. NDAs like @puzzlegal described or your example of keeping general employer behavior secret, are fine and are usually a benefit to relationships and commerce. The second type, buying someone’s silence to cover up embarrassing or illegal behavior, are like @Alessan says, a pox on humanity.
It was my impression that NDAs are unenforceable for illegal behavior, anyway. But it is quite likely any such NDA would be written in such a way that does not admit any illegal activity occurred.
The above example of Cosby is not a good one. That wasn’t an NDA. That was an agreement by the DA not to press charges as a result of cooperation. There was no nondisclosure - or, rather, disclosure was actively required in exchange for non-prosecution.

The above example of Cosby is not a good one. That wasn’t an NDA. That was an agreement by the DA not to press charges as a result of cooperation. There was no nondisclosure - or, rather, disclosure was actively required in exchange for non-prosecution.
Apparently, I was unclear. I never intended it to be an example of an NDA. I meant it to be an example of a case where morality and fact did not line up with lthe law. There isn’t a question that Gaiman repeatedly did immoral things and hurt people. Dependng on the specifics of the NDA, he mey be entitled to both having the money returned and having her pay additional money.

She agreed to take the money to stay quiet. If she didn’t want to stay quiet, then she should not have taken the money.
Worth noting that Wallner had filed for arbitration herself last year, claiming Gaiman had already breached the agreement on his end by not destroying evidence of the relationship like photos and videos she had sent him. He denies any such thing of course.
So this isn’t a salvo out of the blue, but likely a thought out tactic. Already under threat of an arbitration on the NDA, he counters with his own easier to prove charges since he could have destroyed the materials he was originally supposed to only after the fact. I hope she has a text where he admits to something like looking at a picture after the period when he shouldn’t have had it. If she can prove he breached the NDA first I’d imagine she would prevail. OR if she can prove it was a coercive quid pro quo relationship, which should render the NDA invalid.
But if it’s just a lot of he said/she said, it’s tough. But regardless he is certainly burning his bridges with the whole “likability” thing.

But if it’s just a lot of he said/she said, it’s tough. But regardless he is certainly burning his bridges with the whole “likability” thing.
Yes. Is he hard up enough that half a million dollars is worth losing in the court of public opinion over? I think “suing the victim” is the final nail in the coffin of his career.

Is he hard up enough that half a million dollars is worth losing in the court of public opinion over?
If he can even recover that amount in fact. One wonders if Wallner has those kind of assets considering her previous situation. Can’t get blood from a stone. Which if so would just make this purely punitive rather than rent-seeking.
Most likely, the intent of the lawsuit is to silence other victims who might be tempted to speak out. He doesn’t care if he actually gets money from her.
Probably punitive.
His future income has been constrained by events but he’s still quite wealthy and maintains homes across multiple countries/hemispheres. He certainly has enough wealth to live at least comfortably for the rest of his life.
The wisdom of such a play is, of course, questionable.
Seems likely to me that the NDA might not be able to keep her from reporting illegal activity to the authorities, but could keep her from talking to the media about it. After all, it would be up to said authorities to decide if laws were broken.
I also can’t imagine that the bad look here is worth $500K to someone with Gaiman’s net worth. My guess is that there are other people who haven’t spoken up yet and he wants to make sure they know he’ll come after them.