Common causes on BMW Z4s
On the Z4, especially with the N52/N54-era engines, the most common causes are:
Dirty or failing VANOS solenoids (VERY common)
Low or old engine oil
Wrong oil viscosity
Faulty camshaft position sensor
Timing chain stretch/tensioner issues (less common but more serious)...