You have not mentioned the mileage of your vehicle yet... but if the P0017 Code has a certain "Persistence of Vision..." it may be due to the following combination of problems of an aging engine:
(1) The Timing Chain has become Stretched.
(2) The Timing Chain Guides have established Deep Grooves within their surfaces.
(3) The expected positions of rotations are lengthened to the point of being unreliable references that correlate the Rotating Crankshaft and Camshafts positions accurately enough to be where they are expected to be by the PCM Programming.
(4) The Camshaft Phaser has suffered from internal wear or damage making it unreliable in establishing the control over 25 degrees of motion using (6) Positional Hall Effect Square Wave Triggers (Three Small & Three Large) built into the Small Reluctor Ring of its design.
(5) Items One, Two and Four ...singly, or in combination with one another.
The P0017 Code is a manifestation of what happens when the absolute position of the Exhaust Camshaft... cannot be reconciled with the absolute position of the Crankshaft during periods of Compression sensitive to the Timing of the Spark to ignite combustion in all Six Cylinders assisted by The Exhaust Cam Phaser.
In the end... it may well become necessary to replace the Timing Chain Set with an OEM Grade Kit from Cloyes consisting of:
(a) A New High Grade Timing Chain
(b) Three Timing Chain Guides
(c) An Intake Camshaft Sprocket
(d) A Crankshaft Sprocket
(e) A New Exhaust Camshaft Phaser (separate from the Cloyes Kit)
This task involves a lot of non-trivial effort... and therefore, is no job for any Novice and will also become an expensive endeavor (twice so, if completed any Dealership Repair ASE Mechanic).
There is a contemporary thread linked involving the presentation of (5) Youtube Videos showing how all of this gets done on the Four Cylinder Variant 2.8L GM Atlas Engine in a Colorado Truck. But if you want to learn more ...watching these will ground you in the Scanner Analysis of the P0017 Code Problem and its bizarre recurrence for NOT being fixed in the Mechanical World at large.
They will also present you with the Step By Step Repair Procedures that are close enough in the main when describing the Dis-assembly and Re-assembly of the Engine to be a real eye-opener to observe of all the problems you will have to overcome ...and more that will need specific attention... with the 4.2L Atlas Motor.
These videos are quite comprehensive and nearly One Hour Long each... so depending upon whether or not you possess the Mechanical Skill Set to take on such a daunting job... At the very least... You can download them and then use the VLC (VideoLan) application to speed search to the sections that concern you the most. This is indeed a Rare Chance to seeing almost every sub-task being performed for both the Analysis of the P0017 Code AND the Complete Repair and is therefore quite valuable to ANY Owner of vehicles that have the GM Atlas 4, 5 and 6 Cylinder Engines under their hoods.
So its the “Ol’ Crankshaft – Camshaft Correlation” problem again... Right?… that pops up its Ugly Head when the PCM triggers either a P0017 or a P0016… and occasionally even a P1345 Code as well that can make even the most seasoned Mechanic decide that since the two out of the three Sensors are...
gmtnation.com
As an example of how instructive these videos will become... since you mentioned finding "Crud" inside of the areas you worked on and then performed an Oil Change later on... This Screen Print from the 3rd Video shows the very poor condition of the engine internals being coated with Gas and Oil Blow By Residue... such to the extent that the Oil Pick Up Tube is so gummed over with Crud that it is almost completely occluded! Poor Maintenance and waiting too long between oil changes sets the stage for excessive parts wear of the Timing Chain Set and a resulting lack of proper Oil Pressure at higher RPM that could be an additional reason why the P0017 is setting.
You must remember that the Timing Chain Tensioner is Hydraulically activated under Oil Pressure to push the Plunger Foot Pad against the Passenger Side Chain Guide. So if your engine looks like THIS one down inside... it could be a factor in the problem if there is insufficient Oil Pressure due to a Blocked Oil Pick Up Tube well above 1,500 RPM.