There really isn’t a proven glitch for this to happen.
Input the code and follow the steps below. Input the code and press L+R and you’ll unlock all the items under the ITEMS in the bag with 995 each. It is best to use it before you beat the game and the Sinnoh Pokedex entries will be transferred over once the National Pokedex is available. The cheat will remove all of your National Pokedex entries.
One important thing is do not use this code and you have the National Pokedex unlocked. Input the code and you’ll be able to unlock the complete Sinnoh Pokedex.