Some people are so certain that God would have never ordered genocide. But then, what about Noah and the Flood? Moses and the Red Sea when he saved the Israelites? Uza and the Ark of the Covenant? Are we to assume that these things didn't happen in scripture?
The kind of thinking that rejects God's very words and twists the words very meaning is contrary to Church teaching with regards to inerrancy and scripture.
Pope Pius XII in his encyclical Divino Afflante Spiritu stated:
"...Later on, this solemn definition of Catholic doctrine, which claims for these books in their entirety and with all parts a divine authority such as must enjoy immunity from any error whatsoever, was contradicted by certain Catholic writers who dared to restrict the truth of Sacred Scripture to matters of faith and morals alone, and to consider the remainder, touching matters of the physical or historical order as obiter dicta and having (according to them) no connection whatsoever with faith. Those errors found their condemnation in the encyclical Providentissimus Deus..."
Pope Leo XIII in his encyclical Providentissimus Deus stated:
"It is absolutely wrong and forbidden, either to narrow inspiration to certain parts only of Holy Scripture, or to admit that the sacred writer has erred. The system of those who restrict inspiration to things of faith and morals cannot be tolerated. AU the books which the Church receives as sacred and canonical are written wholly and entirely, with all their parts, at the dictation of the Holy Ghost."
"By supernatural power He (the Holy Spirit) so moved and impelled them (the sacred writers) to write - He was so present to them - that the things which He ordered, and those only, they first rightly understood, then willed faithfully to write down, and finally expressed in apt words and with infallible truth."
In Dei Verbum the Church makes it know that we as faithful Catholics are supposed to believe this "Since everything asserted by the inspired authors or sacred writers must be held to be asserted by the Holy Spirit, it follows that the books of Scripture must be acknowledged as teaching solidly, faithfully and without error that truth which God wanted put into the sacred writings for the sake of our salvation"
It is evident what the Church has taught throughout history with regards to Scripture being asserted by the Holy Spirit and it is without error.