So how could you have prevented it?
You needed to take that table tennis match seriously, even when your opponent was rated below you. By waking up early enough to eat a good breakfast, by jogging and stretching, by playing a few practice matches, by doing a bit of research on your opponent, and by mentally gearing up prior to the match, you should have given your best from the very first hit! For future tournaments, you need to learn to be serious and give your opponent the proper respect.
After losing the first table tennis game, you should have had some fear. Instead of taking the match seriously, you just dismissed it as an early morning match that would turn out fine in the end. Instead, you should fear losing. This fear of losing would have driven you to give 100% focus and to evaluate your opponent and possibly change your tactics. Some types of fear are good.
Walking off the court after losing the match 3-0, you should have learned how to deal with your loss. So what did you do next… Quit? Mope around the tournament complaining? Following your opponent around hoping that his rating gets adjusted? What did you do? I suggest that you should have learned from that match and move forward. Think back to the match in regards to a tactics change for the next match but DON’T think back to the match in a depressing way. Use that match as fuel to energize your performance in future table tennis matches.