If the battery is disconnected, the moonroof will not operate. The moonroof will not operate correctly until it is reset.
Carry out the following procedure to reset the moonroof and resume operation:
1. Switch the ignition ON.
2. Press the tilt switch, to partially tilt open the rear of the moonroof.
3. Repeat Step 2. The rear of the moonroof tilts open to the fully open position, then closes a little.
NOTE
If the reset procedure is performed while the moonroof is in the slide position (partially open) it will close before the rear tilt opens.
Slide Operation
Jam-safe MoonroofMazda 6 Owners Manual: Door switch removal/installation
Front
1. Disconnect the negative battery cable.
2. Remove in the order indicated in the table.
3. Install in the reverse order of removal.
Rear
1. Disconnect the negative battery cable.
2. Remove in the order indicated in the table.
3. Install in the reverse order of removal. ...
Mazda 6 Owners Manual: Contact Authorized Mazda Dealer and Have Vehicle Inspected
If any of the following warning lights or the indicator light turns on/flashes,
the system may have a malfunction. Contact an Authorized Mazda Dealer to have your
vehicle inspected.
...