The Catholic Church most certainly does INFALLIBLY teach Baptism, or the desire for Baptism, is sufficient: CANON IV.-If any one saith, that the sacraments of the New Law are not necessary unto salvation, but superfluous; and that, without them, or without the desire thereof, men obtain of God, through faith alone, the grace of justification;-though all (the sacraments) are not ineed necessary for every individual; let him be anathema.
(Session 7, Sacraments in General)
… And this translation, since the promulgation of the Gospel, cannot be effected, without the laver of regeneration [Baptism], or the desire thereof, as it is written; unless a man be born again of water and the Holy Ghost, he cannot enter into the Kingdom of God.
(Session 6, On Justification, Ch 4)
The same goes for sacraments like Confession (Sess6, Ch 14).
Those who say water Baptism is absolutely required are indeed in grave error and it is heretical because it is contrary to the explicit infallible teaching of the Church.