A common misconception about natural selection is that it optimizes species. It’s really more about “this has bugs but it’s good enough to cut a release branch.”
Just want to mention this mistake. We are talking about a gene variant, not a trait. Phenotype inheritance is much more complicated than genotype inheritance.