Its training data has so many examples of the original version of the riddle, where the father dies and the mother is the doctor, that it cannot "see" that the doctor could be the father. It does not truly "understand" the world in the way humans do.