Yeah it's stupid, though with this administration stupid seems to be the flavor they prefer.
US would lose a land war with Iran. They’d lose it spectacularly too.
In Afghanistan, there are some mountains, but they are in the middle. The Taliban fucked off into the mountains and they couldn't do jack.
Iran on the other hand is a plateau fortress lined by mountains on all (accessible to US/western allies) sides. A land invasion of Iran means no supply lines and no way out. The words "one does not simply" come to mind. It is essentially the ultimate meat grinder unless you can win decisively in days, which is impossible because the entire apparatus you are trying to destroy is distributed within aforementioned mountains and operates with decentralised/autonomous command that has been preparing for this exact eventuality (being invaded by an opponent with vastly more firepower and overwhelming air superiority) for the last 40 years. Not to mention absolute fucking hellscape it will be for troops on the ground with FPV drones and Shahed flying into clusters of US marines and being broadcast on Telegram.
A land invasion of Iran is empire suicide. You can't win, you can't go home and you are left with just pouring an infinite amount of resources and lives into the most asymmetric and geographically hostile theatre of all time.
But the commitment does not exist at present. No one wanted this apart from a few hawks and the Israeli security establishment.