Think this is a common issue. Think there could be an issue with the track. I'd recommend you speak to Audi. Or get a diagnostic check.
you can reset it by removing the sunroof fuse from the fuse box. Remove the fuse panel with a plastic pry wedge then remove the fuse labeled C9 (sunroof) and then reinstall it. This resets the sunroof calibration. After you install the fuse again turn the switch for the sunroof to open then after it opens fully to turn the switch to close.