Totally normal reaction and not at all something to worry about. I think everyone at least almost passes out at some point in med school or residency. Usually med students/doctors are dehydrated and go way too long without eating and are expected to stand for hours at a time, usually under hot delivery room or OR lights while in 15 layers of clothes. The important thing is figuring out the early signs and having the humility to ask to step out for a minute. If in the OR, most surgeons or scrub nurses will ask that people who are lightheaded just sit down on the floor immediately to avoid passing out into a sterile field (I know re-scrubbing seems like the end of the world in M3, but it's really not... especially if the alternative is falling into a patient cavity and having everyone really upset at you).
In undergrad, I was dealing with a bunch of pain while I was rounding with a doctor I worked with. I realized I was either going to pass out or throw up from pain, and I tried to very quietly ask a nurse nearby where a bathroom was so I could excuse myself without embarrassment. Unfortunately, she took one look at how pale and clammy I was and threw me into a chair while pushing my head between my knees. She then proceeded to stop rounds to yell at the doctors to get me orange juice. They spent the rest of the day asking if the case was too much for me. I was mortified, but it makes for an amusing story now.