1) Foul occurred before time expired or on an airborne shooter: A2 shoots 2 shots, with no one on the line (if the first FT is unsuccessful, the game is over)
2) Foul occurred after the ball became dead: Ignore unless F or I.
(Assuming FED rules, then you can't (well, shouldn't) say that any time after the foul and before the buzzer was a timer's mistake, and you shouldn't put time back on the clock. IAABO might have a different answer.

)