People keep saying that, but correlation does not equal causation.
The folks putting 5e forward as the best version of D&D ever and then point at its success as proof are ignoring that Stranger Things, Big Bang Theory and many other main stream entertainment sources propelled D&D into the main stream, which equates to a lot of success. Critical Role also helped propel D&D(not necessarily 5e) into the main stream.
There's no way to know that 5e's massive success isn't despite the format and not because of it. Perhaps if 3e or even 4e had been released at the time 5e was, they would be even more wildly successful. Or maybe not.
What we can say is again that correlation does not equal causation and while 5e MIGHT be the best D&D ever, we can't just point at the sales and use that as the proof of that claim.