Running switch modifies either machine or user environment.
However, the modification is present in the running shell. Hence, for the next run in the same shell, the calculation for which path needs to be removed from PATH and which needs to be added is messed up.