Hi - I too suffered the dreaded sunroof ticking/clicking noises until today. I had two ticking/clicking noises:
(1) The first noise turned out to be the 9 foam inserts (MY2000 car) stuck to the upper-side of the sliding sunroof trim panel. The foam inserts had aged and become tacky and were making/breaking contact with underside of the metal sliding sunroof panel as wind passed over or via bumps in the road. Each time they broke contact they made the ticking/clicking noise. There's a TSB on replacing the 9 inserts with 6 new ones but like all things Porsche very expensive. I solved the noise by using 9 strips of 25mm wide x 4 inches long self adhesive felt stuck to the underside of the sliding sunroof panel where the foam strips were touching (15mm width would work too). To install I disconnected and slid the sliding sunroof trim panel back into recess. Front 6 x felt tapes were installed with the sunroof closed. Rear 3 x felt tapes were installed with the sunroof in the tilted position. Clean the areas with alcohol first.
(2) The second was far harder to diagnose and fix. This noise was the ticking/clicking many have reported that can he heard above and just behind your head when driving or gently pushing on the roof lining transverse support bar (between the rear window and rear edge of sunroof opening. And like everyone else it was driving me crazy. It turned out to be a very small relative movement between right rear main mounting bracket of the sunroof to the chassis. I've posted images and video to help others. To fix meant getting in and under the roof lining - never done this before. See the First Video - before I started (with coat hook removed). I diagnosed by gradually removing one trim item at a time and rechecking the ticking/clicking was still there or not. Firstly, removed the coat hook trim (ticking still there); then B-pillar trim completely (still there), C-pillar trim partially (still there); A-Pillar trim partially (still there); Uncliped the roof lining on one side (still there); removed the torx bolt (Bolt A in images) securing the aluminium bracket at the junction of the A/B/C pillars and thus exposed the right rear main sunroof mounting bracket (bracket 2 in images) underneath. PRESTO - TICKING GONE. So I re-installed the torx bolt (Bolt A) without the aluminium bracket, tightened Bolt A, and the ticking came back. I then tightened the torx bolts holding bracket (Bracket 2) to the sunroof rail in case they were loose - still there. I could not see why it ticked until I removed the 3 torx bolts (Bolts A, B and C) and the sunroof mounting bracket (Bracket 2). On the rear of the sunroof bracket (Bracket 2) and on the chassis there was the slightest scuff area where the two items had been rubbing together for many years. I stuck some teflon film to the rear of the main bracket (see images) and reinstalled with all bolts (A, B and C) all tightened - NO NOISE.
I also had the same noise on the passenger side, same approach to disassembly and diagnosis. This time it was the left front main sunroof bracket which was solved by just tightening all 3 torx bolt. I now have no creaking, ticking, clicking noises at all from the roof - the silence is now bliss. :thumbup: