Hoping for a miracle here, but is there a move that would lock a single Pokemon in battle, even if the Pokemon using the trapping move switches out?
Example: A Pokemon uses the move _______ on a Ground Pokemon, locking it into place. The next turn a Water (or grass or whatever) Pokemon switches in...is there a move that the first Pokemon can use so the opponent is still locked in for the second?
The answer to this question on this site has a list of every trapping move in Pokemon.
Those moves are: Anchor Shot Bind Block Clamp Fairy Lock Fire Spin Infestation Jaw Lock Magma Storm Mean Look Octolock Sand Tomb Snap Trap Spider Web Spirit Shackle Thousand Waves Thunder Cage Whirlpool Wrap
If the user switches out, the target will be freed.
This line is in the description in the Bulbapedia page of every single trapping move listed above except Fairy Lock and Jaw Lock. Fairy Lock only affects for one turn, so if you switch out, the target still cannot switch out because the attempts to switch happen on the same turn. Jaw Lock traps both the user and the target until one of them faints.
So, to answer your question, there is not a move that does what you request.
It should be noted that in Generation I, Bind, Wrap, Clamp, and Fire Spin prevent the target from switching out during the duration of the turns where chip damage dealt, regardless if the original user switches out or not. This is of course not permanent and is only in affect for 2-5 turns. This effect also happens with Gmax Centiferno and Gmax Sandblast in SwSh.
There are two G-Max moves with the effect of trapping the opponent: G-Max Centiferno (Centiskorch) and G-Max Sandblast (Sandaconda). These effects are similar to Fire Spin and Sand Tomb respectively, but even if Centiskorch or Sandaconda switch out or faint, the opponent will still be trapped and take damage for the expected duration of those effects--which isn't permanent, mind you.
In gens 2-4 only, if you used Mean Look followed by Baton Pass (as opposed to any other method of switching; Umbreon is a possible user of this combo), "gatekeeper of the trap" was considered to be a passable flag, so you could do that and the target would still be trapped while you brought in your setup sweeper or whatever to take advantage of the passive opponent. Starting in Black/White, any form of switching--even Baton Pass--is considered to eliminate the gatekeeper's watch, and this no longer works.