My sunroof on two occasions over almost 2 years decided to do it's own thing.
Turned engine off, turned it back on, opened and closed and that was the end of it.
Both times were spaces about a year apart too.
It's easy enough to get the plastic covering off the sunroof and take a look at the wires for yourself. Could have been water ingress or something simple!
You don't have an aftermarket alarm by any chance? That interfered with the sunroof on a friends mk4 gti.