Against Bob: yes; Against Cindy: no
I'm going to borrow @Trish's example because it's a good one although the conclusions they reach are wrong.
Alice made a green box. Bob signs an NDA never to tell anyone that Alice made a green box, and there is a clause in it that if the NDA is breached, the box is red. Bob tells Cindy that Alice made a green box.
Cindy has a patent on making green boxes. Cindy sues Alice and in the lawsuit puts Bob on the stand.
Situation 1
So, the box is objectively green and objectively a breach of Cindy's patent on green boxes.
Bob is on the stand and is required to answer questions honestly and no contract can prevent him from doing so. He testifies that the box is green. This would be a breach of contract except that a clause that requires a breach of the law (perjury in this case) is void for public policy reasons so Bob cannot be sued for this. However, he can be sued for the initial breach - he may have a public policy defense here because Alice was breaking the law, however, it’s easy enough to construct a scenario where Alice was innocent but suffered loss from Bob’s disclosure.
Cindy can say what she likes because she is not bound by the NDA.
Cindy wins, Alice loses.
Situation 2
Cindy dies - after a long and happy life so we won't grieve too much. To Bob's surprise, he inherits Cindy's green box patent of which he was previously in complete ignorance of.
Bob sues Alice for breaching Cindy's now his, patent.
So, the box is objectively green and objectively a breach of Cindy's patent on green boxes.
However, Bob agreed with Alice in the contract that the box is red and so, legally for matters between Alice and Bob the box is legally red (notwithstanding that everyone knows it's green) and is not in breach of Bob's patent.
This sort of stuff has a name - a legal fiction. Adoption is a legal fiction - adoptive parents are (legally) parents; biological parents of adopted children are (legally) strangers.
Alice wins, Bob loses.