Ulrik,
I didn't have the same problem (didn't have any trouble at all with the factory fitted sunroof).
Only in colder periods, the sunroof operated just the opposite way it has to do.
I explain :
Normally, if you push the button to open the sunroof, it opens a little bit (45°) on the back side. But is still closed on the front.
If you keep pushing : nothing happens. You have to release the button and push again (and hold it) to open completely.
[size=small](or by releasing the button : it stops opening in any way you want)[/size]
To close the sunroof : keep pushing and it close completely.
But :
In colder periods : just the opposite happened with the sunroof of my car. It opens (almost) completely by the 'first' push.
When it stopped, i released the button, pushed again and it opens a little but further.
Closing : it closes NOT completely, but stopped in a 45° opening position ([size=small]or closing ? :S

[/size] ). Then I had to release the button and push again to close completely.
After opening and closing repeatedly for some times, it operated correctly again (in those colder periods). Sometimes it didn't, but the next warmer period : everything was OK.
So, maybe you didn't release the button and didn't trie again to close completely ?
Is it "greased" enough ? Although : I never did (nor did the garage, I think...).
Or : just before closing (last 5 or 6 cm), the little metal "deflector" (wich isn't a real deflector...) has to go down. When it doesn't go down, I think the sunroof can't get in its "closed" position.
It's that "thing" wich goes from one side to the other and you can move it down by hand / finger and it springs 'automatically' up again. It begins about 10 cm from the front of the sunroof up to the other side and is attached with the rest of the sliding bar wich operates the sunroof.
Have fun with the Y and watch out for the rust underneath !
[size=small](mine '97 with sunroof couldn't get through the yearly technical control cause of the rust

)[/size]