I am not a psychologist, and first and foremost, I think you should at least consult the school psychologist and talk to her to see how serious this may be.
From my own experience though, I don’t think this is a sign of depression. For instance, you say she’s particularly smart. If this is the case, she’s going to have a skewed perspective of what that means. She’s going to get a lot of talk up about how great she is, which can do a lot toward making those failures more difficult to handle. Particularly kids just don’t have that level of perspective and will see what they are able to do as normal, even if it’s exceptional, and falling short of that bar as a failure, even if it’s still better than normal.
Particularly based on the piano example you gave, it sounds like she just hasn’t developed the perspective and coping mechanisms to deal with that sort of thing. It will be important for you to work with her to get the proper perspective that, for instance, her ability to play that piece is exceptional and struggling with it is perfectly reasonable. It will also be important for her to find a healthy way to vent that frustration. For now, she just says those sorts of things, but even if they have little or no weight now, they could become a problem over time.
I think phouka gives some good ideas about how to help with that sort of stuff. Kids just don’t have the level of understanding of their emotions and all of that, and she may not even have a full grasp on frustration when it’s escalating. That is, she may only realize once it’s become too much for her to manage. Chances are, you can detect some of these signs before she does and you can help her identify them so she can handle them before it gets too intense. Similarly, my approach when she does get into that sort of mood wouldn’t be to ask her to focus on why, it’s irrational and probably only gets more confusing and thus more frustrating. When she gets that way, I think talking about how she’s feeling, emotionally, intellectually, physically whatever and then once she’s calmed down may help her identify what that emotional state is and what’s setting it off. But she’ll never get any sort of grasp on it and why while she’s in an irrational state.
So, yeah, I don’t think it’s necessarily all that big of an issue right now, and in fact she very well may develop perspective and coping on her own, but she’d definitely benefit from some help from her parents and some advice from a child psychologist. And in the case that it is a sign among other less seen symptoms of something like depression or bipolar, that’s all the more reason for at least a consultation now.