Hello all,
Brand new to the forum and Z4 ownership. Sorry to revive an old thread but I had this problem with my new Z4 and this is the thread that came up in my Google search and helped me fix the problem. Hence, I thought I'd add some additional info to hopefully help out anyone in the future.
To remove the headliner and access the wiring loom firstly move the roof to the following position:
Remove torx screw on each side of the roof as shown (1 each side)
Remove four torx screws along front of roof headliner (2 each side of the latches)
Remove access panel at the front of the roof (just pull on it) and remove one torx screw
With a small amount of force the plastic trim will now come off the roof and bring the fabric of the roof liner with it.
You will now be able to see the wiring loom along the passenger side and front of the roof leading to the motor at the front of the roof.
Feel along the wiring loom until you find a "fat" bit where the wires are bent. This was in the front left corner of the roof for me. Alternatively carefully cut open the length of the outer sheath until you find the problem.
Cut and solder in replacement wiring to fix the breaks/bends. Cover in shrink wrap/electrical tape as appropriate. Wrap everthing in sheath or electrical tape to keep it all together. Put everything back together in reverse order to the above!