I think there is a possibility Iran will lose in the long run.
They have shown they don't have enough missile to destroy Azerbaijan and Qatar.
Azerbaijan now knows they can keep attacking Iran with drones without repercussions.
Qatar knows they can keep assisting refuel american/israeli planes without repercussions.
Iran simply don't have enough missiles, they only had enough to force Mutts into a ceasefire.