What happens when someone pertinaciously holds and refuses to reject in light of Dogma, a serious theological error?
That depends on the degree of logical separation from said dogma. That's what's known as the theological notes. There are many degrees of error short of heresy.
BoD I don't even consider "error" per se, but rather a theological speculation which cannot be proven. Those who hold BoD correctly (e.g. St. Robert Bellarmine) make distinctions that preserve the core teachings of the Church regarding ecclesiology and Sacramental theology. But it's pure speculation, and when the proper distinctions are not made (as 99.999% of BoDers do NOT make these distinctions), it almost invariably involves heresy.
But I just find it unthinkable that the Church could declare someone a Doctor of the Church when he taught heresy. No, there's no strict guarantee, theologically speaking, so call it a pious belief.