I can't claim to be an expert. At best, I'm an armchair psychologist. However, when I had my bouts of clinical depression, I learned that there were common triggers for stress. They included death of a close loved one, changing job status including a new job, moving to a new home, change of marital status, and new additions to a family. These "stressors" contributed to whatever ailed you and could trigger anxiety and/or depression. They all come from the same thing, which is another topic in this forum - facing the unknown as brought about by change. New situations make us fearful just because we feel unprepared. We like to know where we are going, what we are doing, and why we are doing it. In a new situation, we do not always have that luxury.
To be honest, based on what I read, I think it has to be impossible for divorce to NOT affect your mental health. The question is whether it made you feel better or worse, and whether the long-term or short-term effects were the same. For my mother's divorce, she fled an abusive situation by leaving home for another city and becoming hard to find. Her ex didn't pursue her because he ended up in jail for other reasons. But she found a loving man in my father and she found some happiness. For my wife's divorce, as her marriage had soured she became sadder and angrier. But then she found me and I found her. (Yes, I say it that way intentionally.) She claims to be really happy with me and I am happy with her as well. So in both cases, the long-term mental health improved even though the short-term situation was frightening to both, causing much anxiety and uncertainty.