"How does one company going out of business cost the rest of them money?"
Broadly:
A lot of small companies set up when gas was comparitively cheap and lured customers to them with cheap deals. They didn't plan for a future when prices might go up, maybe hoping they'd make a killing if prices dropped. Prices went up. They couldn't provide the gas to their customers so went out of business.
Better run companies (generally larger) had looked at the number of customers they had and made a fair estimate of the gas they would need into the future. They bought this gas for months into the future, (this requires them to have funds to do this, another part of being better run), and could negotiate reasonable prices as the suppliers were assured of selling the gas. All of this is more expensive, so their customers didn't make the savings of those who opted for the cheaper companies.
The government does not allow the situation where some people just can't get gas, so the better run companies were obliged to take on a lot of new customers. But they hadn't pre-booked their gas purchases for these customers in advance so had to buy the extra gas at the higher prices at the time. They couldn't charge their new customers the higher price that they were costing the company, so they had to increase prices for everyone. Sometimes they had to change meters and other infrastructure for the new customers, which added to their costs. Their ongoing costs - salaries, insurances, buildings, maintenance, and yes, paying their lenders (ie shareholders) for their liquidity, etc - continued. As we know, the price they can charge at any time is capped, so as wholesale prices increased it got harder and harder to make up the loss.