The problem is how the game is coded to work.
In earlier games there were 4 slots for pokemon, Player 1, NPC 1, Trainer 1, Trainer 2, so a max of 4 (or in Gen5 6) pokemon could be on the field at the same time and only the data for the current pokemon was loaded. So when the catch code was used, it then catched the currently loaded pokemon.
But in this game (and maybe SWSH too), it was changed to load all pokemon of all trainers at once and only use an index to show which pokemon is on the field.
So when catching a pokemon, the code is only able to select between "Trainer 1 and Trainer 2", and since a wild pokemon will always be at index 0, the catching mechanic only trys to catch the pokemon at index 0.
This is not so easy to change, because the code behind this is the same code that is used for all battle mechanics offline and online, so an ipc based command system does the heavy work of sending the catch command to the scripting system.
Currently i can't do anything to fix this, use the Encounter Code as an alternative.