Is this for SwSh? I know that it won’t let you catch Pokémon if it’s above a certain level, depending on how many badges you have (from what I’ve played so far, it looks like the level cap increases by 5 per badge). This is presumably to prevent players from getting lucky and catching (for example) a level 50 Pokémon in the wild area before the second badge and plowing through most of the game with it.
I haven’t tested it myself, but I’m pretty sure that’s what’s going on.