Years ago, I was the center judge at a World Championship event when a high ranking Master brought a student over to the ring and changed his belt right there on the spot. Since the Master out ranked me (and was a relative of the tournament director), I excused myself from the ring, explained my reason for leaving, wished the competitors luck, and left the competition never to return to judge there again.
It is a shame to have such things take place, as tournaments could be a great learning tool for students. Now I carefully pick the tourneys I attend with my students, and I still teach them to go there to learn. If they get a medal in the process... great. If not, congratulate the winning competitor, and learn from any mistakes you might have made. If no mistakes were made, you simply experienced the fact that some folks can do some things better than others... and that is life.