Allah did not say that they cannot make mistakes. What Quran says that Allah is razi with them (knowing their weakness and the fact that they can make mistakes).
Prophet says (and I am paraphrasing) that people of my time (my companions) are the best and then the ones that come after them and then the ones that come after them. Prophet was not comparing the intelligence or muscles or beauty but eeman of the people.
When I read the above hadees, what amazes me that we who sit about 40-50 generations after sahaba some how thinks that we are in a position to judge them. After reading that hadees, we should worry about what is going to happen to us and leave the end of Sahaba with Allah and his rasool.