Ofgem said the error affected more than 20,000 customers at the UK’s largest supplier Octopus Energy.