I envision a single dinosaur sprouting little, beentzy wings, unable to fly with but heavy enough to make it less fit to survive.
Then, I picture it being devoured by a t-rex who specializes in eating mutants.
Finally, I see the big evolution roulette wheel spinning and spinning for eons until at long last the cycle and pattern are repeated.
Oh, kinda like these guys?
Note there's nothing about them that should lead you to conclude they were trying to fly. Your mistake is in thinking evolution had a wing in mind, rather than asking whether feathers on a long arm that could be raised over the head could be advantageous in and of themselves.