Yes. It's a common way of diagnosing whether the sensor is bad on a 3.2 (swap one with the other).
Note that if you're getting codes for the CPS, it's usually not a bad sensor but a symptom of something else. Those sensors don't often go bad. Usually the root cause is an oil pressure issue; - phaser issue, rocker/hydraulic lifter issue or cam lobe wear or sometimes a faulty injector issue (if accompanied by misfire codes).