In a regular criminal case, the intent to inflict harm is a felony and punishable by prison time.
The intent by Iran was to kill and injure thousands, with that much intent with missiles and drones.
That is wasn’t successful does not mean that Iran should not be punished. No punishment means that Iran will try again. Iran and their proxies have been trying to destroy Israel for many decades. They will not stop, even if they know that Israel has pretty good defense weapons, and allies that can come to their defense. A criminal will be emboldened by a failure to be punished.
I think there may be some credibility to the idea that Iran knew they would do no damage, but were able to imply “solidarity” with the Gazans without bringing the wrath of Israel on them. Now they can walk away from Gaza with the excuse that they “tried”.
I’m not saying I believe that - or that I don’t. I’m just saying that something along those lines is actually happening here.