I have passed out from having a blood test, of all things, as i have a pretty bad phobia of needles. Part of the reason it got to the point where i passed out is having to wait outside the pathology labs(?) in the hospital for your turn. You keep thinking about it and your heart beats faster. You become light-headed, and then when you're finally in the chair, it feels like you're about to collapse, sound starts to fade away and become muffled out, everything starts going hazy and black and white and you're out of it. The nurse kept asking me "Are you alright? You look extremely pale..." and i kept nodding and saying "Sure, i'm fine!" before it got to the point where i couldn't hear anything anymore and fainted on the chair. At that point, the nurse had to stop the blood test and pull the chair back so i was lying down with a fan kept on me for a good while until i was conscious again. Since then when i go to have a blood test or vaccination i have to lie down before i'm jabbed in case i pass out again.
I'm not really sure why i have a phobia of needles or why my body freaks out to the point of shutting down like that. Intellectually i know there's nothing to fear, but phobias are not always rational.