Try a reset of the panoramic roof:
1. Switch off your X3 until everything goes to sleep.
2. Turn the ignition to ON position - do not start the engine.
3. Press and hold the tilt button, the roof should start moving after a few seconds, keep on holding the button until it finishes its resetting procedure.
That worked for me when it stopped moving in the tilt position.