I help a friend with his daughters 2003 TJ last weekend. Similar problems. Code indicated the camshaft position sensor, he replaced it, still had the code, put the old one back in and the code went away. Had problems driving over 50mph or 2000 rpm. Eventually went back to the new sensor. The Jeep ran fine for a week.
After I look over the wires to the CPS, the Jeep started running good again. Messed with the wires again and it died and would not start. Blew a fuse. We inspected the wires to the CPS, they were fine. Then we found the wire going to the Ignition Capacitor, just below the dipstick bracket to the block, was missing the insulation. Taped up the wire, replaced the fuse and it is running fine so far.
He find other posts on the web about the same problem.