A company which left customers without gas for months has received the largest-ever enforcement action, of £44m, from the energy regulator.
Ofgem said Cadent also had no records of 775 high-rise blocks of flats.
That discovery was in part prompted by an information request from a council in the wake of the Grenfell Tower tragedy.
The company offered an "unreserved apology" to customers who were without supplies for 19 days on average.
"We aim to put customers' needs at the heart of everything we do, and we acknowledge that in the past, we have fallen short of customers expectations and the higher standards we have now set ourselves; for this, we are sorry," said Steve Hurrell, chief executive of Cadent.
Cadent, previously known as National Grid Gas Distribution, is involved in the final leg of piping gas into people's homes.
It owns four of England's eight regional distribution networks - north London, the West Midlands, the North West of England and eastern England. It did not supply Grenfell, but received an information request from a council following the tragedy.
Many of the customers affected by the gas outage were in north London. Some had their gas cut off for more than five months
Jonathan Brearley of Ofgem told BBC Radio 4's Today programme: "When they were making repairs, people had their gas cut off for far too long.
"So in London, people in tower blocks were off for an average of 19 days and some were off for several months. We think this is unacceptable.
"If they do not look after their customers in totality, then absolutely they will either lose their licence or indeed they will suffer further financial penalties."
The penalty takes two parts: £24m for improvements and compensation and £20m for a community fund, which will receive 1.25% of Cadent's after tax profits. The firm's operating profit last year was £724m.
The company admitted that its regulatory data supplied to Ofgem showed that it was leaving residents in blocks of flats without gas for longer than necessary.
It also reported to Ofgem that it failed, over a six-year period, to compensate up to 12,000 residents left without gas for more than 24 hours.
It also reported to the regulator that it did not have records of gas pipes - or risers - in many tower blocks in its London network.
As part of the penalty, Cadent - which supplies gas to 11 million properties and 3,347 blocks of at least six storeys - will double compensation payments to customers who experience an unplanned disruption of longer than 24 hours, at a cost of £6.7m.
It will also pay £300,000 - double the amount first envisaged - to 2,140 customers who faced delayed compensation in 2018 and 2019.
The Health and Safety Executive is investigating the record-keeping issue and will publish its findings in due course.
Are you a customer who was affected by the gas outage? Email your experience to [email protected]
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways:WhatsApp: +44 7555 173285 Tweet: @BBC HaveYourSay Text an SMS or MMS to 61124 Please read our and