There are a few possibilities for the code which includes dirt and debris in the oil, a bad sensor or a bad solenoid valve, or even timing chain in extreme cases.
Since you have the fail-safe at 3,500 rpm, then it points at the VVEL solenoid as the most likely culprit.
However, if you would like to make sure what the issue is before replacing, here is a test that you can do for free. Since you have a code reader, it will make troubleshooting much easier.
Take out that bank 2 intake camshaft sensor and exchange it with a different location. Scan the car again to see if the code changes:
1. If the code changes, then the sensor is bad
2. If the code stays the same, then the problem is related to the solenoid.
Worst case scenario? A broken solenoid that you need to replace anyway -
my-m56x-won-t-rev-past-3500-rpm-no-ses- ... 20590.html