IMO it would be the VVT solenoid/actuator.
If it were the Bank A Sensor being bad, (P0016) it wouldn't detect
a fault in the timing at all.
At the point it is causing the CEL code it hasn't advanced/retarded
the timing properly and as you suggested has an
intermittent non-function that clears up by the time you
reset the code.
Jumping a tooth on the timing chain would cause a
very incorrect valve timing and engine miss type of idle.
A replacement is next, could it be the intake or exhaust ?
One has a gray connector the other a black connector.
Both cost around $26 - $35 each.
I'm sure there is an electrical troubleshooting guide for
diagnosing this part on the internet.
Then again it could be as simple as a loose or
intermittent connection at the VVT solenoid/actuator itself.
Good luck on your repairs.
Sent from my SM-G930P using Tapatalk