The exact same thing happened to my 83 year old mother. I'm convinced they do something to them in hospital, which makes them a bit dotty.
My mother was mentally ticking when she was taken into hospital last summer with a heart complaint and breathing problems. When she came out she seemed different, she is now more forgetful, her short term memory is terrible and she has become childlike, often making bizarre claims, the latest being, that her olderst Grandson is trying to kill her.
I have also heard of this happening to other elderly people. Pehaps they give them sedatives, which affect them badly.