thanks for your help guys.
I've taken the car into Mercedes who ran an electrical diagnostic check and found 3 of the (I think it was 6 total) microswitches that sense the roof mechanism position to be defective.
As the vehicle is under warranty these will be repaired foc. I am negotiating with them about the paintwork repair...
I'll let you know how successful I am.