This is so wrong I'm not sure you understand common sense economics and by economics I don't mean anything you can find in a text book. If I invest nothing, the other investors or traders can still make a profit without costing me anything.
Opportunity costs are never real costs. If I have $10, and the traders do weird things with the prices and I don't spend the $10 on anything, I still have $10. The traders failed to cost me.
You're also ignoring the underlying issue which is that the valuation of SpaceX on the open market is different than the valuation it could get from forcing index funds to buy in early. If the stock is worthless then short sellers will make money, but short selling only works if the short sellers don't get squeezed. If the passive funds buy two weeks in, then early traders know that they can sell to a greater fool at inflated prices. Any short seller who is trying to discover the true price will stay back and short directly after the indexes have bought. That's the perfect moment for them. They want the post IPO hype and bull market, only for the stock to collapse within a year.