I don't develop life critical systems, but I do develop critical infrastructure with billions of dollars in flight daily.
I am also under international legal regulation, and need to comply with a raft of stuff around money laundering, sanctions, foreign actors, insider trading, tipping, etc. etc. etc. There is mention of 15 years jail time, plus fines totalling twice the profited amount.
However, appealing to extremes asides. Software license agreements have to be VERY carefully written. Software development contracts have to be very carefully written. When I say, "very carefully written" I mean your contract terms and conditions must be compatible with your insurance company, in addition to any local regulations and laws.
An EXTREMELY important aspect is the "Limited liability" clauses. If they don't hold like concrete in court you can be screwed over for whatever the customer believes your software cost them. So if your devices goes "dead" for 48 hours and it brings a production line to a halt for 48 hours, that could amount to $500,000 in lost revenue claimed against your failure to provide what you contract stated you would.
A "fair" limit on liability to strive for is "Liabilities not exceeding the total contract cost.". So if after the software + consulting + support they have paid you (invoiced) $16,000. If that software deletes all their company records and causes $3 million in damage, you only get screwed for $16,000.
Get insurance. Make sure your contracts are written well. Spending a few hundred dollars to have a lawyer review your contracts might save you a few thousand in legal fees later. Legal fee insurance as part of your professional and third party liability insurance package is usually standard.