It wasn’t that.
It was locked and fired by somebody.
You are correct.
A military statement carried by state media said the plane was mistaken for a hostile target after it turned toward a sensitive military center of the Revolutionary Guard. The military was at its highest level of readiness, it said, amid the heightened tensions with the United States.
In such a condition, because of human error and in a unintentional way, the flight was hit, the statement said. It apologized for the disaster and said it would upgrade its systems to prevent future tragedies.
It also said those responsible for the strike on the plane would be prosecuted.
It wasn't human error or unintentional unless you consider the lack of coordination protocol between the airport and the missile battery at the end of the runway.
With all the ‘trigger happy’ Iranians or non-Iranians in their country it could have been any group.