Welcome to ja.com
I hope i can be of help to you today.
I'm afraid i am inclined to agree with your lastest mechanic on this problem. I have seen it a few times now on the 2.2 diesel engine, granted though it has been in the primera, but this is the same engine. The timing chain guides actually wear and the chain stretches slightly so the camshaft sensor and the crankshaft sensor get mixed signals and think that top dead centre ( which is what the sensors are looking for) are in different places and so puts the car into limp mode. A diagnostic check would've brought up the fault of one of the sensors because the ecu thinks that one of the sensors is giving a false reading. Also when you remove the plug from the camshaft sensor it will run better but you will still be in limp mode.
Unfortunately for youself, the only thing you can do is get the chain and guides replaced. It is a very big job to do i will say. Probably about 8-9 hrs work because of the limited space and the amount of stripping needed to do the job. In essence the whole side of the engine needs to be removed to do this job.
I'm sorry to be the bearer of bad news for you on this occasion.
Please remember to rate my answer as this is how i get paid and any feedback is very much appreciated. If you require any futher help on this matter, you can still post on this thread even after you have accepted my answer as this doesn't close out the question as i strive for customer satifaction with the service i provide to customers. Also, i would just like to add that if you require help in the future, you can contact me on this site via my profile and i will be happy to help you again.
Thank you in advance