Only Vedas and not any other text are considered to be infallible. However, infallibility does not mean that every passage and every word is literally true.
The appeal to the infallibility of the Vedic injunction is
misconceived. The infallibility in question refers only to the unseen
forces or apurva, and is admissible only in regards to matters not
confined to the sphere of direct perceptions, etc ... Even a hundred
statements of sruti to the effect that fire is cold and non-luminous
won't prove valid. If it does make such a statement, its import will
have to be interpreted differently. Otherwise, validity won't attach
to it. Nothing in conflict with the means of valid cognition or with
its own statements may be imputed to sruti.
REF: Srimad Bhagavad Gita Bhasya of Sri Sankaracarya translation by Dr. A. G. Krishna Warrier, p. 629.
Here is another example of how the greats have viewed the Vedas.
Vedas and Reason
Personally I take as much of the Vedas as agrees with reason. Parts of the Vedas are apparently contradictory. They are not
considered as inspired in the Western sense of the word, but as the
sum total of the knowledge of God, omniscience. This knowledge comes
out at the beginning of a cycle and manifests itself; and when the
cycle ends, it goes down into minute form. When the cycle is projected
again, that knowledge is projected again with it. So far the theory is
all right. But that only these books which are called the Vedas are
His knowledge is mere sophistry. Manu says in one place that that part
of the Vedas which agrees with reason is the Vedas and nothing else.
Many of our philosophers have taken this view.
Of all the scriptures of the world it is the Vedas alone that declare that even the study of the Vedas is secondary. The real study
is "that by which we realise the Unchangeable". And that is neither
reading, for believing, nor reasoning, but superconscious perception,
The Complete Works of Swami Vivekananda, Vol 5, Sayings and Utterances