This is a tricky subject! There are people who are mentally ill, some of them are YEC. The same goes for atheists and everybody else. We need to be really careful about diagnosing people because A) we aren’t psychologists, and B) online interactions tend to give a very biased very of people and groups. With those cautions in place I will venture the following opinions and experiences:
I have encountered a few people online who seem to be not well. Some of those were YEC, and some were atheists.
A reasonable person, given a respectful discussion, can consider opposing views despite their fervor. I’ve have some great discussions with YEC even tho we were far from any agreement. That is no guarantee of mental stability, but I think it is a good sign.
At risk of further diagnosis, I encounter some people online who might qualify as having Narcissistic Personality Disorder. Again I do not think this is any more common among YEC, atheists, or any other groups. BUT I think these people tend to have a larger presence online; It may seem as tho they are more common. I think it is possible (I have no proof) that religious people who are narcissists may be drawn to views of Biblical infallibility.
Belief in Biblical infallibility combined with a belief in personal infallibility is a really bad combination.
Atheists probably have just as many narcissists, but don’t have the Biblical infallibility problem to focus them to a single theme in the same way that YEC’s might be.