This might be a rare edge case case involving unforseen circumstances. For rare cases like this (presuming that that's true), we probably don't want to set up a whole communication apparatus, since doing so is quite expensive. Instead rely on common-sense ad hoc decision making, just like the doctor in question did.
We just need a small caveat in the rules that only people the doctor doesn't know (either directly or through a mutual acquaintance) are allowed to receive an unplanned shot in this manner, to eliminate the incentive to do it on purpose. As well as some accountability after the fact, depending on the details of the case.
The outcome of this is fairly tragic, I consider this doctor somewhat of a hero and here he is being punished by unthinking bureaucrats. What a shame.