Assuming gym leader is around like 25?30? or 50? and you get them back at that level? I mean this matters a lot.
If you leave the player too long with his second team, you just force them to create a new balanced team and when he gets his old team back what then? It is very likely that the teams are incompatible so one team just gets boxed. If you are a one team player like me, you still lose half of your progres anyway. For player which take pkmn in rotation this is not as bad but the punishment in itself is a lot harsher since they lose more pokemon. Also you need to be very carefull with the mechanics you give the player access to. Allowing breeding, gathering shards/heart scales for nature/move changes can result in a lot of players fed up with the game and stopping there. So I would disadvise this, it can work but you have to be very careful.
For short durations, it can work better. Make a makeshift team get past the challenge. Get your team back. How you scramble that team can be done in different ways.