There are many organisms that are not perfectly adapted to their environment. For example, sharks don’t have a gas bladder to control their buoyancy (which bony fish typically use). Does this refute the theory of evolution? No, not at all. Natural selection can only randomly favour the best of what is available, it does not purposefully turn all living organisms into one super creature.
It would be really convenient if humans could photosynthesise; hunger could be immediately cured by standing in the sun (and the much-sought miracle diet would have been found: stay inside). But alas, the genetic ability to photosynthesise has not appeared in animals. Still, selection of the best option possible has led to an amazing diversity of forms remarkably well adapted to their environments, even if not perfect.