This seems very close to an indavertant whistle situation. I'd probably invoke that rule's solution. If one team was in control of the ball, the ball would go back to them for a throw-in.
OTOH, it isn't an inadvertant whistle. The buzzer does not make the ball dead. In the first case, since everybody stopped and your partner waved the substitute in, you could get away with calling it "good as dead." That isn't a rule, obviously, but you gotta handle it somehow
In the other situations you posed, you've also got to handle it. As I said, the horn does not make the ball dead. And at least some of the players kept on playing. In all three of the situations you posed, I'm probably going to carry on as if the horn had not sounded and consider the action as it happened (i.e., count the basket, record the foul, call the violation).
Then I'm going to replace the clock operator since he's screwed up four times now