Related [0], but one week ago I have written about my experiences using TypeScript for an invoicing system, if anyone is interested. It's especially about rounding errors and how to prevent them. Since then we have created hundreds of invoices (and cancellations) and everything worked as expected with minor hiccups in between.
Sounds like you really went though a rough time building the invoicing system!
I have read many times about the difficulties of dealing with decimals/rounding but never found an article that nailed the explanation as well as you did
[0] https://www.robinwieruch.de/javascript-rounding-errors/