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 be 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?
Yet another question: 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?
----- P.S: I know the beetle could make everyone bad if enter their bodies; but couldn't it make people bad by inducing the loaded bad behaviors in their brains?