Now I'm not an expert at source engine so take everything I say with a grain of salt.
What I think happened is that the medic was at 145 to 149 health, being ready to regen +6 in the next tick.
Having the +6 added at the exact same tick as the headshot, the server calculated that the medic gained and lost health (starting at for example 147) looking like this:
147 + 6 - 150
Now because the +3 buff was instantly neutral again within the same tick the server didn't remove the minimal overheal that would've been without the headshot.
I suppose it could also be something related to lag compensation but yeah it's my guess.