If the matter is as you describe, then your fast is valid, because your nosebleed did not happen by your choice, so the fact that it happened does not mean that you broke your fast. The evidence for that is the fact that sharee’ah seeks to avoid making things difficult for people, such as the verses in which Allaah says (interpretation of the meaning):“Allaah burdens not a person beyond his scope”
“Allaah does not want to place you in difficulty”
And Allaah is the source of strength. May Allaah send blessings and peace upon our Prophet Muhammad and upon his family and companions.