In the Vincennes incident the AEGIS tracking software at the time reused tracking IDs for targets, and re-assigned a tracking ID from the airliner to a fighter jet 110 miles away, leading to mistaken information being relayed about the flight's activities.
This goes to show until and unless we know what information the missile system operators had, and what orders they were under, we can't really say what happened and why.
In many ways it's a more surprising accident since in those days the U.S. was not expecting an Iranian attack, but Iran has good reason to be on high alert and expect US warplanes now.
The US did eventually acknowledge the incident and pay reparations to Iran. What are the odds Iran does that to Canada now? Approximately zero. I'd be surprised if they even admit it, even while cornered. A number of Iranians here in Canada think it was the US that shot down the airliner. Pretty ridiculous, but if westernized Iranians living in the free world can think that, imagine what people in Iran would be willing to believe when lied to by their government.
Not now but this will become another bargaining chip and one day they may agree to pay compensation in the context of wider negotiations.
Libya agreed to pay compensations for Lockerbie 20 years later as part of wider negotiations and it is unclear whether they were involved at all...
Something like this -> https://imgur.com/a/kOkRAhd
Friendly aircraft have transponders to identify them. And even without a transponder, certainly a large, slow airliner looks very different on radar than a small, fast fighter or missile.
Seems like the system would require some kind of override to fire at a friendly target.
A U.S. Navy ship, the Vincennes shot down an Iranian airliner in 1988 by accident.