Hard processes in diffractive deep-inelastic scattering can be described by a factorisation into parton-level subprocesses and diffractive parton distributions. In this framework, cross sections for inclusive dijet production in diffractive deep-inelastic electron–proton scattering (DIS) are computed to next-to-next-to-leading order (NNLO) QCD accuracy and compared to a comprehensive selection of data. Predictions for the total cross sections, 40 single-differential and four double-differential distributions for six measurements at HERA by the H1 and ZEUS collaborations are calculated. In the studied kinematical range, the NNLO corrections are found to be sizeable and positive. The NNLO predictions typically exceed the data, while the kinematical shape of the data is described better at NNLO than at next-to-leading order (NLO). A significant reduction of the scale uncertainty is achieved in comparison to NLO predictions. Our results use the currently available NLO diffractive parton distributions, and the discrepancy in normalisation highlights the need for a consistent determination of these distributions at NNLO accuracy.