Blimey, lots of babies get formula in the early days and go on to bf successfully. Equally, lots of babies also get formula in the early days and don't go on to bf successfully.
Both reasons why your babies were given formula, from what limited info you provided, do not show any medical need for formula. I am not saying these things to belittle what you have accomplished by any means. It is just further indication that formula is given very often when it is just not necessary. What the mothers really need was some time with a knowledgeable hcp on the ward.
I have personal experience with this giving of formula when actually, it was the bfing that should have been fixed.
It may be that you never had the most frequent problem which cause most babies to get formula in hospital which is bad positioning.
This normally leads to cracked bleeding and painful nipples painful engorgement, a continually crying baby, etc., etc. which is harrowing for a mum who is so charged up with hormones. In most circumstances like this in the early days, bfing will most likely fail.
I hope you have a long and happy bf relationship with your next one!