Mistakes happen for a lot of reasons they are largely human error, skill based or planning based as you might call it, they are mostly skill based slips or lapses in memory are the most commonly identified. It is rare that a computer or machine makes a mistake without an incorrect algorithm or piece of code being entered somewhere.
Would an AI have the same problem as a human? Ironically yes, built on data harvested from the masses they are stuck in a world of indecision and self-interest created by humans, the mistakes they make only affect humans and there has to be some kind of cruel irony in that. We created them to assist us and feed it information which bears no resemblance to us and expect it to understand and solve our problem, is this a realistic feat? If we refine the input data then the whole system would obviously be significantly augmented, humans are only predictable to a point so it will still be a tough job for an AI to truly understand them no matter how developed they are.
Potter was an AI with little understanding of the outside world having only really existed in the lab and and the building that surrounded it, the information it was fed made it confused, the expected logical behaviour was replaced with a twisted sense of reality and a bucket load of indecision, that was humans for you though, unpredictable and unreadable, one day they would understand each other fully and live in harmony, until that point it was going to be a long and strange road of development on both sides. The mistakes Potter made were essentially human caused by unpredictability.