  We consider the production of a Z boson decaying to leptons in association
with a bottom-quark pair in hadronic collisions. For the first time, we compute
predictions at next-to-next-to-leading order (NNLO) in QCD, and we combine them
with the all-orders radiative corrections from a parton-shower simulation
(NNLO+PS). Our method represents the first approach to NNLO+PS event generation
applicable to processes featuring a colour singlet and a heavy-quark pair in
the final state. The novel two-loop corrections are computed for massless
bottom quarks, and the leading mass corrections are restored through a
small-mass expansion. The calculation is carried out in the four-flavour
scheme, and we find that the sizeable NNLO QCD corrections lift the
long-standing tension between lower-order predictions in four- and five-flavour
schemes. Our predictions are compared to a CMS measurement for Z boson plus
b-jet production, achieving an excellent description of the data.
