If the panorama sun roof detects a resistance while it is closing (e.g. caused by an object trapped in the mechanism), a safety cut-out will be triggered and the roof will open again automatically. If the roof will still not close automatically after you remove the object and operate the switch again, you can use the safety cut-out override to close it.
After the sun roof opens automatically, pull and hold the switch within 5 seconds until the sun roof is closed.
If you release the switch before the panorama sun roof is fully closed, it will open again automatically.