Cheat codes are often sloppy when editing values. Chances are it just sets everything to 999, doesn't bother to check if that's a possible value.
If you have certain impossible values when going to interact with some of the legendaries or mythical pokedex entries, the game just soft-locks, or will even prevent you from catching that legendary/mythical because it refuses to spawn.
This is also why you should keep savefile backups, with JKSV or Checkpoint. If you had an older savefile from BEFORE using that cheat, you would be able to just undo the damage yourself by restoring an old clean backup. Now if you want to fix it you unfortunately have to do Slayer's suggestion of fixing your pokedex progress by hand.