The first time this happened was a physical product with intention to sell to a very large American company with which my company had a relationship going back decades. I did as I was told (did not get to step 5 until after release, there were steps in between 4 and 5 which caused me significant political blowback). Ultimately they did not appreciate the corner cutting and declined to purchase. My quitting moment came when I was asked to be involved in mislabeling product to indicate it was up to standard X when it did not come to our supplier that way. The pressure I was put under to do that put me in therapy. I was a recent graduate with a young child, tough times. A year after I quit, my former company was parted out.
The last time this happened was software used for planning national infrastructure. Case 1,2,3 were common cases that would give very obviously incorrect results. The naive case was if a sliding parameter was always set to one particular value, opening that value up to change was a can of worms that required a whole new architecture. Ultimately I held my ground with the PM and said I would not build it incorrectly and implied it was a dealbreaker for me. I convinced the architect and PO of the correctness (PM was former frontend and had no clue what any of the backend stuff meant). Ultimately I ended up on the PM's (my manager) shitlist and the PO (apparently with the memory of a goldfish) couldn't understand why that feature slipped several sprints. I had better things to do so again I quit. I don't really expect that company to last too much longer at least in its current form. There were already "pivots" on the horizon which gave me deja vu (I expect company owner was gearing up for a sale).
In both cases there were pretty bad shakeups (unbeknownst to me) in the year prior to my joining. In the last case I would have appreciated a friendly heads up from a buddy at the company (they no longer had a real QA dept, they were all fired for "poor communication").
I guess I joined these companies because I have a soft heart for companies with deep history. I certainly learned a lot but my beard is a bit greyer than I'd like for my age. I think the rot was too deep to point out in each case without royally pissing of some of the longest tenured, better than betraying my ethics I guess.
I've had good work in between the first and last where my raising the flag was taken quite seriously and procedures were updated to mitigate, but still I feel I have a black mark on my name.