I repeat this from 2017 in response to a query.
Bishop Richard Williamson of SSPX published some months ago an article arguing (these are his words) that in the post-conciliar Church, sacraments are increasingly going to be invalid. "If [a priest's] ideas of what the Church is and does do not correspond to the Catholic realities, how can he intend to do what the Church does, and so how can he administer true sacraments?"
I hesitate to criticise a Wykehamist - many of my best friends are Wykehamists - but this quite simply is not what the teaching and praxis of the Western Church has always been. It has, for example, been held and taught (see Apostolicare curae, the sentence beginning "Quo sane principio") that even a Moslem could administer baptism validly if he used adequate form and matter - perhaps in baptising a baby about to die in the delivery room whose mother has asked for this to be done. The unbeliever believes nothing about Baptism except that this is something Christians do. His only intention is to do what Christians do. His action is valid, but if it in any way depended on his personal beliefs, it would be invalid.
The Church's standard teaching is graphically expressed by S Robert Bellarmine: "There is no need to intend to do what the Roman Church does; but what the true Church does, whichever it is, or what Christ instituted, or what Christians do: for they amount to the same. You ask: What if someone intends to do what some particular or false church does, which he thinks the true one, like that of Geneva, and intends not to do what the Roman church does? I answer: even that is sufficient. For the one who intends to do what the church of Geneva does, intends to do what the universal church does. For he intends to do what such a church does, because he thinks it to be a member of the true universal church: although he is wrong in his discernment of the true church. For the mistake of the minister does not take away the efficacy of the sacrament: only a defectus intentionis does that."
Cardinal Franzelin gives an extreme case: a daft priest who didn't want to confer grace when he baptised but actually believed that by baptising he would consign someone to the Devil - there was a seventeenth century rumour about this in Marseilles. Non tamen, he writes, sacramenti virtutem et efficaciam impediret.
He qotes Aquinas in support.
In nineteenth century, the Holy Office declared that Methodist missionaries in Oceania who explicitly denied in the course of the Baptism service itself that Baptism regenerates, did not thereby invalidate the Sacrament. Heresy or even total Unbelief is, in the traditional Theology of the Western Church, NOT the same as a Defect of Intention. Defect of Intention means a deliberate intention not to confer any Sacrament at all, NOT a mistake about what the Sacrament is or confers. Bishop Williamson's theology, despite his admirable desire to be Traditional, is NOT the teaching of Catholic Christendom. Pope Leo XIII reiterated this truth in his Bull Apostolicae curae in the section which begins "De mente vel intentione ...".
This has to be right; otherwise the validity of any sacrament would be at the mercy of any rubbish that some fool of a cleric had mistakenly got into his daft head because he misunderstood what he was taught in seminary or was just a perverse nutter anyway; every Mass celebrated by a 'liberal' priest who believed that it was merely a community supper, would have to be invalid.
Williamson's view superficially seems common sense; but Catholic teaching, since the anti-Donatist controversy, has been firmly on the side of believing that it is very difficult for a minister to invalidate a sacrament by his own sin or stupidity or schism or even heresy or total unbelief ... as long as he Does the Red and Says the Black with at least a habitual intention of Doing Stuff (and not, for example, of performing a didactic demonstration or a blasphemous parody). And all this is ultimately based upon a very simple truth: the Sacraments are not ours, but the Sacraments of the Lord Christ.
I am of course quite aware that this teaching presupposes the use of adequate Form and Matter. Do not bother to write in and explain that to me. I simply wish to establish what the Western Church teaches about sacramental intention qua intention.