Yeah, I have failed checks and tests before. It's easy to blame the aeroplane/weather/instructor but the bottom line is that there is a bench mark and you just have to hop over it.
I could give you every excuse I have wanted to give... but all you have to do is look back over the flight objectively and see where you fell down. Your examiner should have debriefed you too.
View it as a learning exercise. That's what I have done with all my various stuff ups. "Where did I go wrong, what can I do to fix it?" Also, remember that you should have done some things correctly. Note those too.
Failures will occur in life. To change it from failure to success is up to you. Sit down with your instructor (or get a new one) and work out a plan of attack that will sort out the faults.
There aren't too many pilots around that haven't blown a check or a test of some sort. Mind you, not many will admit to it.
If it hasn't been a test or a check, you can fail to do a drill/action properly and stuff up. It's called character building and you have to dig deep.
Good luck and report back when you have passed.