I guess the Genitive here is used because of the negation.
The positive would be "On pamięta panią".
Am I right?
Pani means lady so I wrote this: 'he does not remember her' and it is wrong. Why? Thanks
In such a phrase, although it is 3rd person singular, it is in fact the formal 'you'. It's not some lady who is not remembered, it's 'you'. The closest translation would be "He doesn't remember you, madame".
"On nie pamięta tej pani" would be in fact "He doesn't remember this lady", but if there isn't any demonstrative pronoun or something similar ("On nie pamięta żadnej pani" = He doesn't remember any lady) that means it is the formal singular 'you'.