Yes, parent poster said that index funds "seen as this wonderful thing that cannot go wrong." But nobody who knows anything about investing sees them that way. Index funds invest in stocks and bonds, a broad index fund will pretty much mirror the market. But the market, even the market as a whole, is far from safe.
What an index fund does guarantee is that holders of the fund will do better than the average of the "active" investors, who try to pick and choose the best stocks in the index (which for a broad index is basically "the market"). This is because the active investors, as a whole, receive the "market return", but they do so only after investing resources in researching the companies (which index funds don't do) and because the active investors trade a lot, relative to the index fund, so the active investors incur much greater transaction costs. An index gets the market return, but without incurring the costs active investors do, so the index is certain to have a better net return than the average of all active investors. This doesn't mean that index funds are "a wonderful thing that can never go wrong". It's certainly possible for the market to tank, in which case it's little solace for index fund holders that they beat the performance of the average active investor.
What an index fund does guarantee is that holders of the fund will do better than the average of the "active" investors, who try to pick and choose the best stocks in the index (which for a broad index is basically "the market"). This is because the active investors, as a whole, receive the "market return", but they do so only after investing resources in researching the companies (which index funds don't do) and because the active investors trade a lot, relative to the index fund, so the active investors incur much greater transaction costs. An index gets the market return, but without incurring the costs active investors do, so the index is certain to have a better net return than the average of all active investors. This doesn't mean that index funds are "a wonderful thing that can never go wrong". It's certainly possible for the market to tank, in which case it's little solace for index fund holders that they beat the performance of the average active investor.