Dealing with mom guilt over how my process of coming out has affected my parenting

I was in the process of accepting myself when I ended up getting pregnant unexpectedly. I put it aside and wanted so badly to just be a good mom and a wife. When my son was 10 months I went to the psych ward for the first time partially over suicidal ideation from the shame I felt over realizing I’m a lesbian. I ended up in the psych ward two more times due to past trauma and incidents affecting loved ones triggering psychosis. My son is now almost 19 months, and I feel like I’ve wasted so much of his life in my own head, instead of focusing on him. His father and I are separating and he’ll be living with him most of the time for now until I can get a more stable living situation for myself and a car. I feel like such a failure and in a dark place mentally. I feel selfish for the chaos I put him through and for being incapable of providing more for him. I’m Mexican and in my culture moms are supposed to be the main caregiver, I feel so ashamed. I’m mad at myself for developing attachments to two women while going through this, how dare I even let myself indulge in romantic love when I’ve been failing as a mother. Has anyone else been in a similar situation? I really need support and don’t have any family to lean on and most of my friends are either childless or living the dream with a happy marriage and being the best parents they can be.