Fixed #22279 -- Prevented dummy backend going through DatabaseErrorWrapper

Thanks Daniel Hahler for the report and Tim Graham for the review.