Welcome! dolfinx zeroes the rows and columns of the mass and stiffness matrices corresponding to the Dirichlet dofs and fills the diagonal entries with the optional diagonal keyword argument of assemble_matrix. Hence you get N modes with frequency \sqrt{\frac{K_{diag}}{M_{diag}}}. You can set the diagonal values to appropriately large/small values so that these modes are outside your range of interest: