Personal guess, her father is the one that went back in time and chose to give her the memories back, the grandfather did say "You'll regret this!" and he was probably right, likely after whatever spell/illusion Cosette used wore off on him. It's already been shown that magic can 100% alter your memories/perception, if she could 'fake' spirit summoning there's no reason she couldn't charm the Duke and twist him around her fingers, the only real question is WHY Cosette did it.
If she wanted Duchal power/authority she could get it much more easily without a conniving plot to introduce herself as the true daughter and drive Kiera to the guillotine, especially if she really did have spirit magic...