What you are thinking of is a perfect AI running bug free software. You need to consider the more realistic situation that your robot doctor is using a decision tree constructed by Microsoft, and its actuator firmware are from Toyota.
Let's not forget that humans aren't perfect. We cant process as much informations as computers and we make a lot of mistakes all the time. After all, to err is human.