In the linked question the requirement that is allegedly a lie is in a severance agreement which states that:
The contract has terms that require me to tell anyone who asks that I
was not, in fact, laid off, but instead that I voluntarily resigned
from the company.
I would not call that a lie. It is, instead, a mutual agreed change in the reason for leaving employment, that by virtue of an agreement for severance being executed, becomes true. The termination of employment may have initially started out as a layoff, but once you agree to leave in exchange for a severance payment instead, it becomes a voluntary resignation.
The colloquial meaning of the word "lie" includes lots of things (like broken promises) which are not considered to be lies in the legal sense, or even if a more strict sense of the word "lie."
Similarly, a contract hiring you to be an actor and in the course of an acting performance, to say things that are not factually true to an audience that knows you are acting, is also not a lie.
The set of things that aren't legally fraud (which would cause a contractual requirement to be void as contrary to public policy), but are "lies" in a strict sense yet aren't illegal, is pretty narrow.
It might encompass a contract as a P.R. agency for a political campaign that requires that agency to produce materials consistent with a candidate's message. But there aren't all that many other examples I can think of.