WARNING: This page is about a different car, the 2024 Mazda CX-30. However, it is still accessible from the selected car via links, so may be relevant.
Set the wiring harness to the position shown in the figure so that it does not get caught between the roof panel and the headliner.