I am sorry you are where you are at right now: that it is so terrible in bleak. I'm sorry if the words I used have contributed in any way. The internet is great but it's hard because there are no non-verbals and I can't clarify "in the moment".
I think you are taking far too much responsibility, and seeing your depression as THE factor resulting in x and y and z.
We are at a unique point in history where, as parents, we take full responsibility for how our kids "work out" and any difficulties they have. Our mothers would probably laugh at us. Our grandmothers almost certainly would have. This places unbearable pressure on mothers in particular, who have probably always felt guilty whenever their child suffers in any way because now that's just what mothers seem to do. We are important in our kid's development but we are not the be all and end all: they trot out their own path in spite of us, no matter what we have done with them or to them or around them.
I also think that when you are a mother being treated and recovering from depression, there is always going to be sadness at missing out on having had nicer and happier times with your kids (e.g. totally apart from any issues with your kids). When, in and amongst all of these normal feelings, your child has issues, it is totally natural for you to wonder if you somehow caused them and, because you are a mother and mothers always feel guilt, feel guilty about that.
I think it's good to talk about these because they are misplaced, but completely understandable, fears given what you are now going through. I have worked with all sorts of families over the years, going through all sorts of things, and the truth is that there's just no pattern of events that shapes any of us, is there? Development is an interaction of the brain and the body and the world around that body and in the context of your kids, you are one cog in the wheel. An important cog, but there is no way that you having had depression could lead to your ds2 having to go from dr to dr (unless you locked him in a cupboard and starved and beat him, which as you say, you didn't neglect or harm him in any way).
"It would mean that the friends and family that 'drifted away' when i asked them to stop telling me that i was wrong were, in actual fact, right"
No, it wouldn't. If they were unsupportive and not there and blaming you for any concerns you had about your kids, they were wrong and not right no matter what.
Kids don't develop symptoms of something like reactive attachment disorder because their mum, though ill and feeling like shit, was doing their best to fulfil all their needs (even if she felt like she was going through the motions). Reactive attachment disorder arises from a situation where a baby's needs are persistently and continuously not responded to e.g. think of that baby in the current NSPCC add who is strapped into a buggy outside in the cold. There are women who are so severely mentally ill that that is how they cope with their children in the ravages of their illness. That's not their fault, but it does have a stronger correlation with how their child develops.
From what you are saying on here, you were a mum who was absolutely doing her best to be the best mum that she could be: a mum who cared for and loved her kids through one of the most pernicious experiences a mother can have. PND/maternal depression is so utterly unfair: it robs you of happiness when you should be at your happiest. But it is NOT your FAULT. And your child's issues are NOT your FAULT because they CAN'T be caused by that. If anything, it's the other way round. Your ds2's issues probably either triggered your feelings or compounded how you were already feeling and prevented you from seeking help at the time because they complicated your depression.
Does this help? Or am I still making it worse??? I hope not. I just want you to see that its normal that this has been going round in your head all this time, but that this does not mean that what's been going round in your head is right! I can't say it enough: your ds2's issues are NOT your FAULT.