Plenty of evidence contradicts the efficient market hypothesis, showing that it's possible to outperform the average. The market's late response to Covid is a case in point.
The gambling analogy holds up only when you compare it to poker or sports betting, where you can make money if you're better than others.