The Bible is infallible in all that it asserts as true, on any subject, including history and the physical sciences.
Pope St. Pius X condemned the idea that “Divine inspiration does not extend to all of Sacred Scriptures so that it renders its parts, each and every one, free from every error.” (Lamentabili Sane, ‘Syllabus of Errors,’ n. 11).
Pope Pius XII: “they put forward again the opinion, already often condemned, which asserts that immunity from error extends only to those parts of the Bible that treat of God or of moral and religious matters.” (Humani Generis, n. 22)."
Pope Pius XII: “The sacred Council of Trent ordained by solemn decree that ‘the entire books with all their parts, as they have been wont to be read in the Catholic Church and are contained in the old vulgate Latin edition, are to be held sacred and canonical.’ In our own time the Vatican Council, with the object of condemning false doctrines regarding inspiration, declared that these same books were to be regarded by the Church as sacred and canonical ‘not because, having been composed by human industry, they were afterwards approved by her authority, nor merely because they contain revelation without error, but because, having been written under the inspiration of the Holy Spirit, they have God for their author, and as such were handed down to the Church herself.’ When, subsequently, some Catholic writers, in spite of this solemn definition of Catholic doctrine, by which such divine authority is claimed for the ‘entire books with all their parts’ as to secure freedom from any error whatsoever, ventured to restrict the truth of Sacred Scripture solely to matters of faith and morals, and to regard other matters, whether in the domain of physical science or history, as ‘obiter dicta’ and — as they contended — in no wise connected with faith, Our Predecessor of immortal memory, Leo XIII in the Encyclical Letter Providentissimus Deus, published on November 18 in the year 1893, justly and rightly condemned these errors and safe-guarded the studies of the Divine Books by most wise precepts and rules.” (Divino Afflante Spiritu, n. 1).