The first search for the doubly heavy Ωbc0 baryon and a search for Ξbc0 baryon are performed using pp collision data collected via the LHCb experiment from 2016 to 2018 at a centre-of-mass energy of 13TeV, corresponding to an integrated luminosity of 5.2fb−1. The baryons are reconstructed via their decays to Λc+π− and Ξc+π−. No significant excess is found for invariant masses between 6700 and 7300MeV/c2, in a rapidity range from 2.0 to 4.5 and a transverse momentum range from 2 to 20GeV/c. Upper limits are set on the ratio of the Ωbc0 and Ξbc0 production cross-section times the branching fraction to Λc+π− (Ξc+π−) relative to that of the Λb0 (Ξb0) baryon, for different lifetime hypotheses, at 95% confidence level. The upper limits range from 0.5×10−4 to 2.5×10−4 for the Ωbc0→Λc+π− (Ξbc0→Λc+π−) decay, and from 1.4×10−3 to 6.9×10−3 for the Ωbc0→Ξc+π− (Ξbc0→Ξc+π−) decay, depending on the considered mass and lifetime of the Ωbc0 (Ξbc0) baryon.