Exactly what risk did they take on? A few missed dividends, and two years for the stock price to recover?
As for the second bankruptcy, the main result of that was that their customers ended up paying the bill for other customers whose houses were destroyed. But you are partially correct, the shareholders did take a haircut of a few percentage points from stock dilution. I wouldn't be too upset for them, the stock's now double what it was before the bankruptcy.[1]
California's cities wanted them to take a haircut of 100 percentage points, but that clearly didn't happen.
[1] For some reason, the wise stewardship of the shareholders and the board did nothing to mitigate the crisis that caused the company to get sued for 50 billion dollars. They were too busy squeezing dividends out of it to worry about liabilities. [2]
[2] And why should they? They aren't personally liable.