I think this is fairly common. When you play a practice match you will be far more relaxed, you will be familiar with your opponent's style and the outcome of the match doesn't really count for anything. When you play a league or tournament match, you will have more nerves or tension, your opponent may be unfamiliar and you have the extra pressure that the match counts for something. And remember the other player is not there to make you look good. The other player is trying to make you play bad. What can you do about this? If the issue is nerves, you can do something about this (read my article here:
How to deal with nerves in table tennis matches or read
this thread on the same topic). Consistency will come with time and lots of practice. You will have to practice, practice, practice. There are no short cuts. Practice. Then more practice. Try and seek out players whose style you find difficult and practice with them too.