I don’t think the catechism is infallible. It’s only infallible when teaching on faith and morals already infalibbly defined. So it could be wrong in theory. It doesn’t define anything, but just acts like its apparent.
In my opinion, it is a phsycological problem, influenced by genetic and enviromental causes, with the enviroment being more important. the genetic factors might make one more prone to be enviromentally affected by personality, like greater emotional sensitivity, or sex atypical interests, but the enviromental factors can either waylay the problems associated with those, or feed into them.