Texas’ power grid was “seconds and minutes” away from a catastrophic failure that could have left Texans in the dark for months, officials with the entity that operates the grid said Thursday.