No, the Church TEACHES that the Grace of Christian Baptism is necessary.
No, the Church TEACHES that the Grace of Baptism may be applied without the ordinary aquatic ceremony through desire (or blood, which is really just a subset of desire).
The Church does not TEACH that this Grace cannot be applied in some other (but unknown) manner.
I think you have misunderstood this doctrine, because you have not read enough different magisterial sources on the subject. The CCC can be misunderstood, if it is not read in the light of Tradition, Scripture, and other magisterial documents.
Trent: “CANON V. If any one saith, that baptism is free, that is, not
necessary unto salvation; let him be anathema.”
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 indeed necessary for every individual; let him be anathema.”
Vatican I: “there are seven sacraments of the new law, truly and properly so called, instituted by our lord Jesus Christ and
necessary for salvation, though each person need not receive them all.”
The grace of justification is obtained by the Sacrament of Baptism, or at least by those types of baptism which are an extension of it: baptism of desire or of blood. It is not possible, given the above teaching of the Church on this subject, to say that God may save in some third manner, not connected to Baptism or any Sacrament.
When Vatican II (the source of the CCC assertion in question) taught the following:
“All this holds true not only for Christians, but for all men of good will in whose hearts grace works in an unseen way. For, since Christ died for all men, and since the ultimate vocation of man is in fact one, and divine, we ought to believe that the Holy Spirit in a manner known only to God offers to every man the possibility of being associated with this paschal mystery.”
the Council was in no way contradicting past teachings on the necessity of the Sacraments (or the desire thereof) for salvation. It is just that the details of how the Spirit brings non-Christians to that desire (often implicitly) is known only to God.
The Catechism of Pope Saint Pius X:
“29 Q. What sacraments are most necessary for salvation?
A. The sacraments most necessary to salvation are two: Baptism and Penance. Baptism is necessary to all, and Penance is necessary to all who have sinned mortally after Baptism.”