Your example totally ignores how selection works. Life does not generate genes randomly and see what sticks. Prebiotic chemistry might have worked like that to some degree. But at the point oxygen transport was invented every gene in an organism would already been subjected to billions of years of selection pressure and the gene or genes that eventually came to code for hemoglobin would already have had some other, related purpose.