I can guide you !!! This is a well known problem with the E46 sunroof. What happens is that the cover is pushed shut only on one side by the roof when it shuts. (Bad design!) It therefore eventually goes crooked, and the silly little guide (!) pieces break, so the cover comes off its runners and the pusher bends. It is not strong enough to reliably straighten it. There is a "repair set" kit available, part number 54-10-7-134-073. It is the tilting part which fits across the front of the sunroof aperture, the "pusher" itself, 2 pop rivets, 2 lengths of double sided sticky tape, and the corner of the roofs cartridge (made of white plastic), which has the drain connection. You will need the pusher, might not need the corner. Also replace the parts which screw onto the cover itself as well, part number 54-13-8-246-025. Instructions come with the kit.
This happened not long after I got my car, 2 years ago, I took the cover out and left it out. I got the kits, but still have not got around to doing it, its ok without the cover!!