This is a small study of people with OCD that looked at environmental factors focusing on factors around gestation in particular. It found some interesting things. Compared to a control group is seems a couple of things like edema and long labor were more common in those who later developed OCD.

Abstract: Prenatal, perinatal, and postnatal risk factors in OCD (Anxiety Insights)
Prenatal, Perinatal, and Postnatal Risk Factors in Obsessive-Compulsive Disorder