You have been working hard and suddenly on the last question to get practiced status (or perhaps a question on a Mastery Challenge) something happens and you get that dreaded "x". First instinct is to rant about how Khan Academy, or your teacher, is too hard or just mean.
We know this is frustrating! Everyone has had the experience where they are one step away and something goes wrong.
Take this as an opportunity to slow down a bit and double check. It's not so much learning math as learning to slow down; learning to read carefully; learning to double check the hard problems.
Khan Academy is also growing. We know there is a balance between the frustration of being so close and not getting it and the frustration of having to do something over and over that you already know. Khan Academy is working on studying the learning of students to meet this balance through different criteria to achieve Mastery. You may see changes to the criteria for Mastery over the coming months as we try to find the best way to discover if a student has Mastered something.
Khan Academy wants your Mastery to be a true Mastery - a sign that you can get the question right every time (or nearly every time) on your own. When you achieve your Mastery on a tough topic, this is something deserving of real pride. You worked hard and made your way through it!
My final recommendation is to remember "Failing is just another word for growing".