It’s a really important distinction that the invariant has to be an invariant in the real world (e.g. in the problem domain). Programming “right” is context-dependent.
Some programmers try to program to some theoretically correct ideal, even if it doesn’t apply to their particular problem. Or, they may try to make invariants for things that they think they will need to hold true (possibly because of some future requirement).
All of these can lead people to shy away from having any form of invariants.
Agreeing on what invariants exist in the problem domain at a given time is really important for avoiding confusion. That kind of discussion happens all the time with teams who collaborate well and across disciplines.
“Should it possible for that menu and that modal dialog to be open at the same time?” (Invariant)
“A post can’t be published if it hasn’t been reviewed.” (Precondition)
“After submitting a payment, an audit log entry must be created” (post condition)