.You prepare for war during peacetime
Saying that Iranian leadership was foolish that it never extended the IADS into Iraq, Syria, and Lebanon during peacetime. They could have easily put mobile HIMAD/SHORAD batteries there and connected them with radar network starting from OTHs in Iran for initial search/detection while tracking can be done in real time by mobile units. In 3-4 years they could have trained these militaries. Instead they relied upon entrenchment tactics. They kept on sending ground forces which worked yes because, despite the aerial bombing in Syria, IRGC's ground control has just increased and increased in size, but such tactics allowed the enemy to dominate the airspace. This is happening in Lebanon now. You prepare for war during peacetime. Offcourse militaries learn from mistakes.