My condolences for your loss, Lord have mercy.
Breastfeeding as contraception prevents you from menstruating and releasing an ovum, it shouldn't cause you to have a miscarriage. The only way this would happen is if breastfeeding was causing your uterus to contract, which can happen, and this somehow lead to the miscarriage but that seems rather unlikely. I think in this situation you may have just been unlucky. Of course the hormonal issues another poster has, you may have as well. I think you need to speak to a doctor, basically. All I can say is that I've never heard of such an issue before today.
I fell pregnant with my second while I was still breastfeeding my toddler, who was about 14 months old. She was of course eating solid food so I was breastfeeding her part time, usually just before bed. I have had one early miscarriage prior to becoming pregnant with my eldest but no issue afterwards.