Also- the FAA banning flights would have been known to the Iranians. Flying then - would therefore be even more dangerous and while Ukraine is not governed by FAA they could at least avoid the 1-2 hours before dawn known to be the attack window preferred by the US. Any revolutionary guard member manning the anti aircraft would have concluded the chance of a civilian aircraft to be extremely low. The FAA ban came hours before and the Ukrainians would ahve been aware of it. How many of those bans happen a year?
"Several non-US airlines had flights over parts of Iraq and Iran at the time, according to FlightRadar24 data. They are not directly affected by the FAA ban, but foreign carriers and their national regulators typically consider US advice carefully when deciding where to fly."
"Carriers are increasingly taking steps to limit threats to their planes after Malaysia Airlines Flight MH17 was shot down in 2014 by a missile over Ukraine, killing all 298 people on board."
https://www.aljazeera.com/ajimpact/faa-bans-flights-iraq-iran-missile-attacks-200108024141437.html
BTW: Iranian people are sharing pictures I have seen of an anti aircraft missile said to have been fired over Iran last night.