My dad is a doctor in an aged care facility and this is absolutely true. He sees terminal lucidity all the time in end stage dementia patients. Which is fascinating as it shows that the brain has not lost the memories after all, it's blocked from accessing them somehow...
He's also seen it happen before a stroke many times. He had a parkinson's patient who would have mini strokes. And he would know a stroke is coming because she would have a really great day the day beforehand.