If the camshaft position sensor did not fix it, you will have to check the static timing.
The timing belt may have skipped, or if it has VCT it is not working correctly. The VCT can hang from dirty oil or just be damaged. If the VCT solenoid has a problem it usually generates it's own codes.