So you have a question:
Can cooking or baking destroy gluten in flour?
The short answer is No.
Gluten is a type of protein. Yes, proteins can be transformed and broken down (denature) into amino acids by heat.
This has been said to be at temperatures around 260°C/500°F.
But the heat while cooking or baking, along with the time of exposure of food to this heat, is not sufficient enough to destroy gluten.
Think of it this way: If you managed to destroy the gluten in your food, there would be no structure in the food left. That would mean, for example, that the cake you’ve baked would lose all its structure and consistency, and would fall flat.
So there is no reason why you would want to destroy the gluten.
Firstly, it would defy the very reason for you baking something. You use the flour to give structure to what you are baking.
Secondly, even you managed to destroy (denature) gluten, the gliadin component would still be there.
This is the part of the gluten protein that is responsible for the autoimmune response is people with celiac disease.
Conclusion
If you want to get technical: yes cooking can destroy gluten.
That would mean your food would be burnt and structurally destroyed while the harmful part of gluten that would motivate you to destroy gluten in the first place, the gliadin component, would still be there.
So no, realistically, cooking and baking can’t destroy gluten.