I have a State hot water heater that the pilot light goes out when the water heater shuts off the burner. I have replaced the thermocouple and pilot light is okay. I am thinking that it is the thermostat? Needs Help.
Get a Licensed Master plumber/Gas fitter/Chimney sweep to check your flue for a possible blockage. You maybe getting blow back that is putting out your flame.
You need to contact a Plumber Who owns a millivolt tester and knows how to use one. It is the only way to accurately pinpoint the problem. Also, if it is your thermostat (actually the ECO part of the thermostat), it may make more sense to replace the entire water heater. Let your Plumber decide.