They didn’t buy insurance as an expense; they bought it as a tradeable investment asset. They didn’t own the bonds that the insurance contracts were written on (or at least nowhere near as many as they bought insurance for). And there was no “insurance company”. Amherst itself sold the “insurance” — contracts called credit default swaps.
Credit default swaps overwhelmingly exist as market gambling tools, not as actual insurance. If they were being used as insurance, there wouldn’t be swaps “insuring” several times as many bonds from a specific issue, as were ever issued. It’s like if 50 different people held insurance policies on your house. You may have one insurance policy on the house that was actually bought as insurance, but the other 50 people obviously had something else in mind when they bought their policies, since they don’t have a financial interest in the house to begin with (and no, you can’t actually do that with houses as far as I know, but you can do it with bonds).
They made a bet. They bet that the bonds would default. This Texas company realized that the volume of bets outstanding exceeded the market value of the bonds, so it made sense to buy the bonds so they would not have to pay off the bets.