I know these things about Mars and am still unconvinced. A fully independent manufacturing pipeline is completely nuts especially at the quality and quantity levels that we are used to. Many materials are not viable except as biproducts of other processes subsidized by the scale of Earth manufacturing. There is no magic wand that we can wave so that if we want it enough we can have it. If humans are indeed capable of such feats then they are capable of the much easier feat of Earth or Moon colonies. Might as well develop an independent manufacturing pipeline on Earth just practice because you wouldn't want to find out the hard way that a critical step doesn't work and it was all for naught. And if the alternative is to stockpile large quantities of chips or rare earth materials then how long are they expected to last, 100s of years?
Ah! The idea is not for people to just go live on Mars as a replacement to Earth. I agree that is unrealistic on anything even remotely reasonable as a timeframe. Rather it's the opposite! Like you mentioned, even in scenarios that kill effectively 100% of people on Earth, it would still be a far more hospitable place than Mars, with very few exceptions.
So the idea of a backup is not that we just go live on Mars, but rather that we have a significant number of people on Mars (and elsewhere ideally) that can return to Earth in such a scenario, help restore order, find/rescue survivors, and generally get society going again. It's simply the planetary equivalent of being able to send in aid to an area after a catastrophic force majeure.