Yes. The thermocouple for the flame failure device has failed. Based on your diagnosis "it is because the knob controlling it will not stay down," may one suggest you get a competent person to change it out.
If you are going to do it yourself, you will need the make and model of hob to order spares
ewerwq, April 2018
edit
I can answer this question...
Knob will not stay down/on for middle ring on hob?