I never liked getting the interview question about a time that you failed. You didn`t want to give an example that was too trivial, or that might cause the interviewer to lose interest, but you also couldn`t claim to never have failed. It really isn`t a trick question to trip you up. The interviewer is looking to see how you address setbacks and learn from your mistakes. A tremendous amount of growth can occur in failure. Interviewers can often really connect with you over your setbacks and how you recovered, because they`ve done it themselves.
The best example would show that you understood your culpability with what went wrong, picked yourself up, worked on it, and delivered successfully in the future.
Your failure example should be appropriate. Nothing too personal, but not something trivial where there were no real consequences to your mistake/weakness. A team or group experience can be a good area to mine. Did you not carry your weight and let your teammates down, did you crumble under pressure and then turn the situation around later?