Could he have erred, even as the enlightened one?
Yes, a Sammasambuddha does not make mistakes as they are omniscient and do not have any Vāsanā remainders.
It depends on what you mean by failing. Also, for clarity sake, one thing is to ask whether he did made mistakes and the other to ask if people believe he was capable of making mistakes.
If by mistake it's meant a "moral mistake", he is seen as very consistent in the texts and buddhists regard him as incapable of error here. After all, morality is not only his expertise: he is regarded as embodying perfect morality as direct consequence of his accomplishment of eradicating mental defilements (the very root cause of moral mistakes).
If by "mistake" it's meant a "false statement", he is also regarded as incapable of that: the texts explicit say arahats can't lie, and buddhists believe it so. Now, much of the teachings show him going long distances to be careful with what he say, which is particularly suggestive that he was indeed capable of that.
If by "mistake" is meant any action that does not seem to accomplish a certain goal (unrelated to failing morality), this is harder to evaluate and there are some interesting episodes that can be interpreted either way. Also, many buddhists regard him unable to err.
One interesting example that @ChrisW's answer mentioned is the nun order: first, the Buddha said "Do not ask so" to the women looking to be accepted in the sangha, and later on, he finally conceded when Ananda asked in their behalf. In this case:
Those who believe he can err might see this episode as evidence that he either had doubts or had to make decisions without knowing if they would lead to an implicit goal (e.g: of helping more people, growing the sangha, etc).
those who believe he can't err might see this episode as he making the correct decision early when he refused to accept nuns and later making the correct decision of accepting them (e.g. circumstances might have changed)
Unfortunately, both positions make assumptions that are hard to probe. They assume the reasons for the rejection and acceptance which are a mystery to us.
Some people argue that e.g. his allowing Devadatta to become a monk was a mistake ("erring"); others argue that that was no mistake, and had a good outcome (or, at least, best possible outcome).
The fact that the Buddha describes his own, actual experience (of the way to enlightenment), not mere conjecture or hearsay, is a reason for his statements being real or true.
The fact that he was careful when he spoke, e.g. when he doesn't answer the unanswered questions, helps to make him "infallible" (or never-wrong): those are examples of times when he might have failed but didn't, for example the Abhaya Sutta starts with a question which was intended to make the Buddha fail.
I suppose another doctrine which makes it difficult to point to example of where the Buddha "erred" is the doctrine that "each person is responsible for their own kamma": so if someone else (e.g. one of hs students) errs, then that doesn't count as for example a failure in leadership or a failure to teach.
Also I'm not sure what you're asking but given the word "infallible" and your (Mexican) background, perhaps you mean infallible about doctrine, like the Catholic Pope is reputed to be. That's a narrower/more specific question, for example here:
As a biblical example of papal fallibility, Fundamentalists like to point to Peter’s conduct at Antioch, where he refused to eat with Gentile Christians in order not to offend certain Jews from Palestine (Gal. 2:11–16). For this Paul rebuked him. Did this demonstrate papal infallibility was non-existent? Not at all. Peter’s actions had to do with matters of discipline, not with issues of faith or morals.
If you restrict the question to matters of doctrine-and-not-discipline it's even easier to answer "yes infallible; no error". For example the Buddha is said to have reversed his own previous pronouncement on the question of whether women might become monks (nuns), and I suppose someone might argue that must be therefore an example of the Buddha "erring", either in his original decision (that women cannot or may not join the Sangha), or in his reversal (that they can). Similarly, apparently various rules of the vinaya were added over time as necessary. If you exclude all those and say "Well that's about discipline, not about doctrine" then counter-examples to infallibility are harder (if not impossible) to identify.
Also, and I'm not completely sure about this but I'm pretty sure, that the Buddha's words are (i.e. the Buddha's doctrine is) usually understood to be or defined as true.
- If it's the Buddha's doctrine then it's true
- If it's not true then it's not the Buddha's (true) doctrine
You might see an example of that in this answer and this comment where some detail that's published as "doctrine" is assumed to be a later error, introduced into the doctrine by someone else (i.e. by someone other than the Buddha).
There also seems to me to be a certain amount of self-contradiction within the doctrine. I think this is assumed to be (explained as being) because the doctrine is simplified or condensed, maybe for various stages of understanding. If I can try to invent an example of that:
- Suffering exists, caused by desire, suffering ceases when desire ceases
- Actually it's not as simple as "cessation of desire": there are actually two kinds of desire, i.e. wholesome and unwholesome, and it's only the unwholesome desire that you're supposed to abandon
- Actually it's not as simple as "cultivation of wholesome desire" because once you have attained the Wholesome you need no longer desire it for yourself
- Actually it's not as simple as "not desiring it for yourself", etc.
Or here is another example, quotes from A Still Forest Pool (the author was a respected contemporary Buddhist teacher):
Go Left, Go Right
A Western monk at WatBa Pong became frustrated by the difficulties of practice and the detailed and seemingly arbitrary rules of conduct the monks had to follow. He began to criticize other monks for sloppy practice and to doubt the wisdom of Achaan Chah's teaching. At one point, he went to Achaan Chah and complained, noting that even Achaan Chah himself was inconsistent and seemed often to contradict him self in an unenlightened way.
Achaan Chah just laughed and pointed out how much the monk was suffering by trying to judge others around him. Then he explained that his way of teaching is very simple: "It is as though I see people walking down a road I know well. To them the way may be unclear. I look up and see someone about to fall into a ditch on the right-hand side of the road, so I call out to him, 'Go left, go left' Similarly, if I see another person about to fall into a ditch on the left, I call out, 'Go right, go right!' That is the extent of my teaching. Whatever extreme you get caught in, whatever you get attached to, I say, 'Let go of that too.' Let go on the left, let go on the right. Come back to the center, and you will arrive at the true Dharma."
The Middle Way
The Buddha teaches us to keep laying down the extremes. This is the path of right practice, the path leading out of birth and becoming. On this path, there is neither pleasure nor pain, neither good nor evil. Alas, the mass of humans filled with desiring just strive for pleasure and always bypass the middle, missing the Path of the Excellent One, the path of the seeker of truth. Attached to birth and becoming, happiness and suffering, good and evil, the one who does not travel this Middle Path cannot become a wise one, cannot find liberation. Our Path is straight, the path of tranquility and pure awareness, calmed of both elation and sorrow. If your heart is like this, you can stop asking other people for guidance.
You might see that these may appear to contradict each other ("go left, go right, our path is straight"), but I think that it's the student that's assumed to be incorrect or vacillating, and the Buddha (and Buddha-Dhamma) that's assumed to be infallible/accurate.
The question of infallibility is I think related to doubt, i.e. you ask that question when you have doubt about the doctrine. "Doubt" is described in the doctrines, see e.g. Vicikitsa on Wikipedia.
There's further detail in the Vicikicchā article on Dharmafarer, which identifies many types of doubt, and their effect. Towards the end it says that an opposite of doubt is faith:
The opposite of doubt is faith (saddhā), which arises when our doubts about the Dharma or the Vinaya are cleared up. But faith can be already present in us in some measure. We could be faith-inclined people who easily believe others. This is good when we follow good and wise teachers, but bad when we are misled by dubious gurus.
Early Buddhism distinguishes between blind faith or “rootless faith” (amūlika,saddhā), that is, baseless or irrational faith, and wise faith (avecca-p,pasada), that is, “faith with a good cause” (akaravati,- saddha), faith founded on seeing. The Vinaya defines the word amulaka as “not seen, not heard, not suspected.” This definition is a legal one, ascertaining whether something has been seen, or spoken by someone, or suspected to have happened so that proper action follows. But both in a Vinaya and Dharma situation, further investigation is often necessary or desirable for the truth to be revealed. True reality, as a liberating experience, however, can only be discovered by us for ourselves: it is a personal and direct experience.
The word "faith" in Buddhism doesn't necessarily mean exactly the same as "faith" in Christianity (see also this topic).
Also the Theravada tradition teaches that there are Four stages of enlightenment; and "doubt about the teaching" is one of the fetters; and not having doubt about the teaching is associated with the first stage of enlightenment. Especially if you're a 'doubting Thomas' I think that would include seeing/understanding/experiencing the doctrine for yourself.
In respect to the core teachings ('heartwood'), a Buddha is infallible. These core teachings are those of ultimate truth (lokuttara dhamma), namely, the Four Noble ('Ariya' - Irrefutable) Truths, the Three Characteristics, Dependent Origination, the Elements (Dhatu) & Emptiness (Sunnata).
The Four Noble Truths, for example, are infallible because what they explain cannot be disproven by any person, namely: (i) all suffering is egoistic attachment; (ii) this suffering arises when there is craving leading to new ego becoming; (iii) this suffering will end when this craving ends; & (iv) the noble eightfold path ends suffering.
Or the Three Characteristics cannot be disproven, namely all conditioned things are: (i) are impermanent; (ii) cannot bring lasting happiness; & (iii) cannot be ultimately owned or possessed.
MN 117 separates wisdom, & thus the teachings, into two kinds: (i) pure teachings of ultimate truth ("without effluents") leading to liberation ("transcendence" from the world); & (ii) moral teachings ("siding with merit") with "effluents" connected to "kamma" & the "worlds".
In a number of places (MN 136; AN 4.77; etc), it is explained the principles of moral kamma (action) & result ('vipaka') are not exacting but merely general principles (for example, good kamma while generally leading to good results can also lead to bad results).
This makes these explanations (MN 136; AN 4.77; etc) about the non-exact nature of kamma infallible since they cannot be disproven. In other words, the general teachings about kamma (good leading to good; bad leading to bad), due to not being 100% true, cannot be used to deem the Buddha as fallible.
Therefore, anything that is 'worldly' in nature, such as moral teachings about kamma, the success & failure of students, the structure & rules of the Sangha (community, including admission of women), etc, cannot be used to deem the Buddha was fallible.
The Pali scriptures are clear the Buddha kept silent when asked would he lead all beings to liberation (AN 10.95). The scriptures (AN 4.111) are clear about the success of students ultimately depends on the disposition of the student rather than on the instruction of a Buddha.
Again, AN 10.95 & AN 4.111 are infallible, i.e., cannot be proven to be untrue, since Buddhism has existed for 2,600 years and all beings on the earth are not liberated from suffering, let alone 1% of them.
In addition, DN 16 offers the principle of the Four Great References, which allows for scrutiny of contradictions in teachings given by other monks or created in later years. There are contradictions in the Pali suttas (eg. MN 64, which states a new born child has no idea of 'self'; and MN 123, which claims the Buddha had ideas of 'self' the moment he was born from his mother's womb; SN 22.79, which states ideas of 'self' existing in the past are delusions; and AN 3.15, which claims the Buddha declaring he existed in a past life). If the principle of the Four Great References is followed, it is easy to weed out the unverifiable teachings that comprise of a immeasurable fraction of the scriptures (eg. MN 123; AN 3.15) with the core principles found in the vast majority of the teachings (which support MN 64; SN 22.79, etc).
Some teachings (particularly about 'rebirth') may appear unverifiable however this impression only occurs when the language of these teachings is not fully understood. The Commentaries state:
The Awakened One, best of speakers, Spoke two kinds of truths: The conventional and the ultimate. A third truth does not obtain.
Therein: The speech wherewith the world converses is true On account of its being agreed upon by the world. The speech which describes what is ultimate is also true, Through characterizing dhammas as they really are.
Therefore, being skilled in common usage, False speech does not arise in the Teacher, Who is Lord of the World, When he speaks according to conventions.
(Mn. i. 95)
The Pali Canon clearly considers the Buddha to have been omniscient and he was apparently considered to be a reliable oracle by King Ajatashatru, who tried to use him to predict whether his war against the Vajjians would be successful or not (DN 16). Of course, one can rationalize these references and interpret them in many different ways, but the assertion that he was omniscient occurs in the earliest Buddhist texts.