OK. Don't shoot the messenger, but there is a very strong relationship between psychotic disorders and both types/all types of diabetes. If a woman has any type of diabetes while pregnant it is far more likely that her child/children will have a psychotic disorder when they are adults. It is still not a very high chance, but it is higher than the non-.diabetic population. But there is no actual evidence that her control during pregnancy is the cause. There is evidence that psychotic disorders (on the schizophrenia and bipolar continuum) are in the autoimmune "family" and so there is some genetic "crossover". It is a bit difficult to explain (especially because people are not going to want to know this) but basically to have most autoimmune disorders you need damage to quite a few genes (there isn't ONE damaged gene for diabets, and ONE damaged gene for schizophrenia, etc). Some of the damaged genes are the same. So some diabetics also show signs of schizophrenia and most schizophrenics end up with Type 2 as they get older. Until recently that was attributed to the medication, but lately they have started to find that "drug naive" schizophrenics also get Type 2. I know all this because unfortunately about two years ago, after ten years of slow decline my twenty-six-year-old son had his first psychotic episode (in fact it was his second - the first was about five years earlier but was so mild, we just shrugged and ignored it). When he was diagnosed I spent weeks researching it. To be honest I don't feel like recapping all my research, providing links, etc. I read all the original research papers I could find.
In my family in particular we have a whole raft of people with autoimmune disorders. Pernicious anemia, Type 1, Type 2, symptoms of lupus, hypothyroidism frozen shoulder, etc, etc and actually even evidence that people earlier in the family had psychotic disorders - but very mild and manageable. In fact, fortunately, my son's case is quite mild. He has responded to meds, has never been hospitalized and leads a fairly normal life - suffers mostly from depression.
But yes, it's an immune disorder. And no, it is not caused by insulin or change I insulin. It is basically an autoimmune attack on the brain. If you don't take the medication, it is progressive.
And my endo didn't say there's no connection. He said there is a connection, but it's not that MY diabetes is the cause of my son's psychosis. It's that we both inherited a dodgy set of genes, with a slightly different lay out. And we both seem to have had a "viral trigger". Luck of the draw. Or not.