In academic careers, there are times wherein inspite of our best efforts we do not get the desired results, and that is not because of our preparation alone, there are other factors, and that is why it is best to have two options for career - bare minimum so that if plan A is not happening, we can follow plan B. I don't think it would be appropriate for you to feel low and without confidence towards your own self, although I can understand your feelings, but what is needed is to look beyond this issue, and look at life in a longitudinal perspective, and understand that with effort success has to come to you, if not in your choice branch then in some other branch, but it would come for sure. Focus on your academic pursuits, and talk to a professional, take personal and vocational guidance and you would be able to see through this phase of life and move into a much brighter one.