I have a water heater that fires up fine, pilot lights, burner comes on and starts to heat for about 3-5 mins. then it clicks and shuts off completely.

I have a new gas valve, thermacouple, gas regulator, no leaks in line, all other appliances work fine.
Once the pilot is lit and the burner comes on, I can move the thermostat from hot to cold and it will switch from pilot to burner and back to pilot with out a problem.
I have had it in the repair shop and they spent hours trying different new parts, the gas vavle and thermacoupler, and no change in problem. They also called Atwood and they were of no help.

Any suggestions?