I disagree. The US lacks industrial capacity, and it can't refine rare earths on its own right now. You can't just snap your fingers and magic these things into existence. You have to establish supply chains, build factories, train workers, and all that is a decades long process. The US being a big country, did have a ton of weapons stockpiled, but a lot of that got used up over the past 4 years in Ukraine. Even large countries can eventually run out of stocks if the outflow exceeds production, which is precisely what has happened to the US now.
The difference with Iran is also that it's not some small poor country that can't fight back. This is a whole new type of war for the US where the adversary can hit American assets directly.