This may not be true, but I feel there must have been a recent TSB or something about the sunroof, because my dealer had a process, where the end of the process/flowchart is 'new sunroof' if the previous attempts fail (my dealer tried bracket adjustments, and was unwilling to do the foam because they said it would render the sunroof unusable, basically).
But it was a specific and fast process, I felt like they were following something corporate because they were so unequivocal about the sunroof, and also, it was not a hassle. Lol. That's mainly why I felt they were following a dictate from the suits at home.
My dealer used a glass place and body shop that does this all the time, and they did a great job. Putting the headliner and pillars back correctly, well, that was a different story, but after another visit and some time at the detailer and back at the body shop, those after-issues were also resolved. These things are always a process, and you have to the patience to work through them via several visits if you want your problems actually resolved. IMO.