Anti- depressants and miscarriage

I was wondering what your thoughts are about taking anti depressants while trying for a baby. I was on duolextine when I fell pregnant the first time and miscarried at 5 weeks, I then fell pregnant again while still on the meds and miscarried at 7 weeks. I then came off the tablets as I read they can cause miscarriage but miscarried again at 5 weeks. I’m really struggling at the moment and thinking about going back on them. I had been on them for years and my mental health was really stable but since coming off them I am struggling. Do you think they cause miscarriage? Has anyone taken them during pregnancy and had a successful pregnancy?