When? When they drip fed Hezbollah's missiles into Israel's air defences? When they left their ships in port to get bombed? When they convened an in-person meeting at the Supreme Leader's residence? When they didn't even reprimand Hamas after October 7th?
Iran has acted according to its regime's interests. But I wouldn't say they prosecuted their goals rationally, pragmatically or even particularly effectively.