Because it is the Church who gave us the Bible, in 405 AD. Jesus and the Apostles were not reading from the New Testament when Jesus was walking upon the earth. The books of the New Testament were written alongside many, many other books that were written about Jesus, and it took until 405 AD for the Church (the Bishops and the Pope) to discern the 27 books of the New Testament that we today call “the Bible”.
If the Church has the power and the authority to give us the Bible, and we can trust that no error was made when they did this, we can certainly trust the Church on other matters of equal weight, as well - and we can trust the Catechism because it was written by people who have the
same level of authority as those who discerned the books of the Bible.
We had the teachings about Mary and about Indulgences before we had a Bible, as well, so if the Church was “off track” on those things, then we
also can’t trust them to have given us the right Bible, either. You can’t pick one thing that they did, say “This is from God” and then throw out everything
else that they did. Either we believe them in everything and we know that we can trust the Bible, or we don’t believe them in anything, and we don’t trust the Bible, either.
But, it’s insane to trust their work on the Bible, while at the same time not trusting them on everything else, because, either they are trustworthy, or they are not. We can’t pick and choose; otherwise we are setting ourselves up in authority, and God
definitely didn’t give that charism to
us.