In The Fairly OddParents S04E08 (Vicky Loses Her Icky), Timmy wished for Vicky to be nice.
Vicky was breaking the door of Timmy's room prior to the magic being done.
After she became nice, she told Timmy:
You were attacked by a door!
So she doesn't remember her recent acts, and probably she doesn't remember all of her mean acts towards Timmy in this scene (because she didn't apologize to Timmy for her bad treatments). Of course, she remembers Timmy himself.
Timmy didn't tell Cosmo and Wanda to erase her memory; he just told them to make Vicky a nice person.
Is erasing the memory of mean acts by someone necessary for making them nice?
Furthermore, was the memory of mean acts stored in that evil beetle, and when it came back to Vicky's body, she remembered her mean acts against Timmy and became bad again?