I've had the same problem after updating to Angular Material 17.
Addionally the dialog window was placed at the bottom left of the screen.
The solution was to add the line @include mat.core();
inside the theme file after
@include mat.all-component-themes(...);