The reason that the flame does not stay lit is usually due to the connection of the thermocouples to the gas valve not being good enough (given that it is in a good positioned in the flame).
The thermocouple sits with nuts on the backside into the gas tap.
Check if any of these can be tightened so that the contact (transfer of voltage) becomes better.