My Nissan X-Trail was doing the same as Trevor Bowley was recently complaining about in Carsguide. It's possibly one of two sensors that control the cam timing from what I understand from the great mechanics I take mine to at Croydon Prestige Service. Don't let Nissan anywhere near it would be my advice.
It seems the problem is not uncommon with the X-Trail. The best advice is to be assertive if you take the car to a Nissan dealer and insist they fix it.
Disclaimer: You acknowledge and agree that all answers are provided as a general guide only and should
not be relied upon as bespoke advice. Carsguide is not liable for the accuracy of any information
provided in the answers.