The same can be said for any other cognitive variances, including what we call ADHD, Autism Spectrum Disorders, Depression, Bipolar, etc.
And so we frequently see today, numerous people diagnosed with these conditions, experiencing severe challenges on the one hand but great benefits on the other - just consider the number of great artists and writers with ADHD or Bipolar, or inventors with ASDs.
So we don't need to theorise about whether or not these tendencies are sometimes beneficial, and whether they have been selected for in evolution; it's plain to see if you look around.
But it's not necessary to prove the point, we can rely perfectly well on evidence and Occam's Razor for that:
- We can identify highly successful people who are confirmed or speculated to have (or have had) ADHD: Richard Branson, Ingvar Kamprad (Ikea founder), Nikolai Tesla, George Bernard Shaw, Jim Carrey, Walt Disney, Kurt Cobain, Robin Williams. Even if we aren't convinced that each of them exactly fit the ADHD diagnosis (which is inherently fuzzy anyway), we should be able to agree that they are/were all cognitively atypical in ways that are somewhat consistent with the conventional diagnosis of ADHD.
- In each of these people, we can see how their atypical qualities are/were integral to their talent and success, I.e. a rich imagination and enhanced creative capacity; being able to absorb and process many different ideas at once and mash them together to produce new concepts; being comfortable challenging conventional thinking and living outside mainstream norms; having the charisma to communicate new ideas to others and inspire action and change. We can also see significant downsides, most notably in Cobain and Williams who ultimately took their own lives, but anyone with these kinds of conditions will report significant difficulties, which is not surprising; in nature, every benefit comes at a cost.
- We can easily imagine how these qualities would have been beneficial throughout evolutionary history, and how it would always have been beneficial to any society or tribe for a minority of the population to have carried these traits, in order to find new solutions to problems, to invent new systems and technologies, and to break down outmoded traditions and practices to make way for the new.
By your reasoning, ADHD only confers a cost on its carriers, but not one that is severe enough to be selected out of the gene pool. I.e., ADHD is a genetic accident that has continued to be maintained in the gene pool despite having a great cost to the fitness of those who have carried it.
But the "genetic accident" theory doesn't survive Occam's Razor. In addition to it being unlikely to have survived and remained so widespread if it only imposed a cost against fitness, we just don't need to add it into the explanation when the explanation works perfectly well without it: that ADHD-like behaviour is beneficial in the right circumstances, and is necessary to exist in a minority of members of any tribe or society in order for it to survive and progress.