You are most likely battling an opponent with Arena Trap or Shadow Tag as abilities. This ability means that the opponent cannot switch, but for arena trap if the Pokemon is a ground type, then that Pokemon can switch. Otherwise for shadow tag, you can't switch at all. Baton passing, volt switching, or u-turning will still work.
Source – Links above
Another problem is if you click one Pokemon, you must replace it with the Pokemon that just fainted. You first choose the Pokemon you want to send in and choose the Pokemon that fainted and it will take that Pokemon's spot.
Source – Experience