Just gonna be blunt and say that this is a pretty shitty misconception, like saying cancer sufferers didn't pray hard enough or something.
I'm T2D. I'm not going to provide my "fitness creds" (because why would you believe me anyway) but I'll just say it's absolutely not possible that my T2D is caused by poor diet or lack of exercise.
T2D is caused by insulin in insufficient quality or quantity. The pancreas produces insulin. Some people just have a shitty pancreas that produces shitty insulin that doesn't work. If you're overweight then fatty pancreas makes it worse, but it's not the underlying cause.
If you have T2D you can't store glucose effectively, it hangs around in your blood and fucks everything up. Consequently you shouldn't consume carbohydrates which your liver covers to glucose.
T2D is not caused by the consumption of sugar, but people with T2D cannot process sugar.
For a newly diagnosed person with T2D, diet and exercise is indeed the first recommendation, because the meds suck and losing some weight might make smaller doses more effective.
I, and others like me, lost the genetic lottery. I have to stick to an incredibly restrictive diet, and bullshit exercise regime, to delay the inevitable deterioration of my health. Even so I will be lucky to live to 60, and if I do ill probably have ass cancer or amputations or dead kidneys or some other fuckery.
Honestly, stick your "diet and lifestyle" misconceptions up your jumper.