I’m Baptist and signed up for RCIA / RCIC.
If I am incorrect, I hope somebody will correct me.
It is written about in “The Summa Theologica” of St. Thomas Aquinas. See the Catholic Encyclopedia link
newadvent.org/summa/406408.htm
Note “Objection 2” (like saying Question #2) and “Reply to Objection 2” (the answer to Question #2).
I think a short answer to your question is “Yes” as long as the liturgy is correct and the priest looks like he is doing his job. The answer would be “No” if the priest says (expresses) that he does not have the intent.
The paragraph that I think best addresses the question is:
“Consequently, others with better reason hold that the minister of a sacrament acts in the person of the whole Church, whose minister he is; while in the words uttered by him, the intention of the Church is expressed; and that this suffices for the validity of the sacrament, except the contrary be expressed on the part either of the minister or of the recipient of the sacrament.”
Of course, I wonder who the “others with better reason” were, since the writer was St. Thomas Aquinas (a doctor of the Church).