When a burner will not stay lit, the gas control is the most expensive suspect and the least likely.
Three cheaper explanations
Fuel. A supply that is weak or interrupted. Confirm the tank or meter is delivering before anything is opened.
Proving. The thermocouple or flame sensor generates the signal that holds the valve open. Measured, it is either in specification or it is not — and marginal ones fail as they cool, which is why the fault appears overnight.
Venting. A blocked or poorly drafting flue shuts the appliance down. In a timbered neighbourhood this is a frequent finding, and it is also a safety issue.
Testing in order
Inlet pressure, proving output, flue condition. Only after those three are sound does the control become the answer.
Doing the replacement
Isolate the gas, fit the control specified for the model, leak-test every joint, then run a full cycle and watch the flue for spillage before leaving.
Safety
Smelling gas means leaving the building before making any call — to the supplier or emergency services. Soot, scorching or spillage are also stop-use conditions.
Repair or replace the heater
A control on a sound tank justifies the labour. On an older unit, and here tanks age rather than scale, replacement also lets the venting be put right.
What to have ready
Fuel, symptom timing, vent route.