Switching PCMs shouldn't set codes unless you mess up the PCM itself, or something else on the car is messed up. Aftermarket PCMs are essentially the same as stock, with adjusted tables for KR-killing and performance gains.
The only reason you should set a code is if you break something.
Mods do tend to make that easier, as modding sometimes come with a Happy Foot disease.