New member and 1st post I see. Welcome; please feel free to introduce yourself in the New Member section. And the obligatory pictures of course!I had the exact same issue, P0018 and P0021 codes. Engine rattle that kept getting worse, Loss of power and Misfiring while idling, truck actually shut off at a light.
Dealer replaced cam phasers and timing chain. But this did not fix the issue other than the rattle.
Took it back, and dealer replaced the Cam shaft actuators as this was their next best guess of what the issue could be.
Truck seems to be having no issues at this point.
The DTCs you listed are not cam phaser related; those indicate a physical timing issue. Did you buy the truck used? There are no cam shaft actuators, only VCT solenoids and sprockets. Perhaps they replaced the VCT solenoids to resolve the issue? Glad it's running well now.