Are Index Funds too good to be true?

Okay so I am just 18 years old and I want to get into investing early. I have very little knowledge but I've learned about Index Funds and they seem... too good to be true.

So from my understanding (Which could be completely wrong) When you invest in an Index Fund your money in that fund increases by 10% annually. But then it compounds on itself. This means if you put in 10K then after 10 years you would have 20K, but then it would only take 5 years to hit 30K, and 2.5 years to hit 40K, and so on and so forth. I did the calculations and 10K in an Index Fund would equal $452,592 dollars after 40 years. That's a retirement fund right there, Is this actually how it works? And if so, what are the downsides?