This should be written somewhere with huge letters and be the final end of that otherwise endless discussion.
People in HN are really baffling to me in how they underplay luck and overplay effort all the time. And I've seen what you said, on both extremes, like 50 times in my life so far at least.
I don't why that is. A lot of us know that the ego is our brain's top priority but nobody really knows why is that the case.
This also leads to rich people producing various misguided essays in which they are asserting stuff that's way outside their area of expertise -- but since they are rich and popular, many people gulp them as a holy gospel and repeat them ad infinitum...
Eventually we go full circle and start seeing what is the topic of the OP: that there are a lot of widely believed adages without them ever being well-supported by any evidence.
Luck is still a factor, it's just a matter of minimizing it.
Some people work their asses off starting a company, and it never takes off, and some dude who barely knows how to program runs into someone at a party and gets hired for a million dollars to build a dumb website.