Can the Church err in questions of faith?
The faithful as a whole cannot err in faith, because Jesus promised his disciples that he would send them the Spirit of truth and keep them in the truth (Jn14:17).
Just as the disciples believed Jesus with their whole heart, a Christian can rely completely on the Church when he asks about the way to life. Since Jesus Christ himself gave his apostles the commission to teach, the Church has a teaching authority (the Magisterium) and must not remain silent. Although individual members of the Church can err and even make serious mistakes, the Church as a whole can never fall away from God’s truth. The Church carries through the ages a living truth that is greater than herself. We speak about a depositum fidei, a deposit of faith that is to be preserved. If such a truth is publicly disputed or distorted, the Church is called upon to clarify again “what has always and everywhere been believed by all” (St. Vincent of Lerins, d. 450).
CCC section (88-100)