I did that, fixed no problem.
Took the sunroofs out, scraped old sealant, cleaned both frame and roof, and resealed.
Bingo, no more leaks.
Why, when it's a reasonably straightforward solution, do people just stick mastic everywhere and wonder why it still leaks?
;-)