When you bent over to check the broken pedal, your vascular system had to deal with a dramatic change in the pressure needed to supply the brain with blood, which it did. When you stood back up, situation reversed. You suddenly had insufficient blood pressure to supply the brain. As we say on Team Bozo, "No Brain, No Pain", at least until you hit the asphalt.
You may have experienced this after a protracted bout of sitting at a desk and then standing up quickly. It doesn't mean anything is wrong. In fact, it means there is something very right about your pipes.