Mat expansion panel is opened by default bug?

I finally found the problem.

It was about this : *ngIf="selectedIndex == 2". I replaced it by a boolean which is updated when I change tab (MatTabChangeEvent)

    tabChanged( tabChangeEvent: MatTabChangeEvent ): void {
        this.selectedIndex = tabChangeEvent.index;

        if (this.selectedIndex == 2) {
            this.displayBlock = true;
        }
        else {
            this.displayBlock = false;
        }
    }