I don’t know why you think the mito genome is a “very fragile thing” or why this would matter for COI barcoding. (It doesn’t.)
Your question “how did this happen?” seems to presume that the existence of unique sequences in COI is remarkable. I’m not sure that it is. My understanding of the COI barcode is that it was chosen by humans based on the fact that it is ubiquitous because COI is a basic gene required in all living things (that have mitochondria, which of course excludes the vast majority of Earth’s living things, but that’s not important here). The 600-bp region is easy to amplify by PCR, and that was a key technical aspect when species barcoding was first proposed 15 years ago. I think that the gene was already known to exhibit substantial diversity between species. In other words, at first glance, the COI barcode is just a convenient way to look at species-specific DNA sequences for identification purposes. The existence of species-specific DNA sequences by itself is not surprising or interesting, and requires no special explanation other than some measure of reproductive isolation and, of course, common descent from some founding population.
However, I just looked at a recent paper that argues that COI is a particularly good choice, because it is biologically relevant to speciation itself. That is cool and interesting, because speciation genes are cool and interesting, and it seems to imply that the COI barcode was a great idea. But if you read the paper, you’ll see that there is debate and uncertainty surrounding COI as a barcode. I think this is unsurprising, simply because biology and population genetics can be a little too complicated for something as simple as a “barcode” for a species. It’s a great idea, and a useful tool, but not a singular proof or something like that.