I don't exactly have the answer here but I can add this: documentation of mental illness in history can be muddy. Depending on how far you go back and the type if culture you'll find that many mental illness were named and identified differently. You might find that demonic possession among other things would be attributed to perceived mental illness. Only retroactively are we now able to make these connections. For example modern PTSD was called shellshock only a century ago and was attributed to physical battery rather than traumatic experience. Psychology is a relatively new field in comparison to other sciences