Here is the link to Article VIII: https://bookofconcord.org/augsburg-confession/what-the-church-is/
This article makes reference to the Donatist controversy. The Donatists were a schismatic group in fourth-sixth century Carthage. They held that certain sins rendered the ministry of a priest ineffective (i.e. any sacraments he performed were invalid and his prayers were fruitless).
This position leads to a number of problems. Consider what happens when a priest is caught living in immorality. If the Donatists were correct, then everyone that he baptized has a problem: their baptisms are null and void. Hence, they must be rebaptized.
Against this, the orthodox Christian teaching is that the means of grace are not dependent on the character of the person who administers them. To be clear, when a pastor is caught in immorality, it is a great scandal and offense. Although he can repent, receive forgiveness, and be welcomed back into full fellowship with the church, certain sins disqualify him from holding the pastoral office.
However, the following is also true:
- Even if the person who first shared the gospel with you was a hypocrite, the gospel is still true and the word that was preached was still effective because it was God’s word — not a human idea.
- Even if the person who baptized you was a hypocrite, your baptism remains valid so long as it was done with water “in the name of the Father and of the Son and of the Holy Spirit.”
- Even if your pastor committed a grave sin on Sunday morning before church, the Lord’s Supper was still valid because of Christ’s institution and command.