I'm not sure if I can say the ML becomes fully 'good' by the end of the story, but there is a happy ending.
I think her transmigration had something to do with her being the 'key princess' and that one of the doors she could open in the strange palace basement might lead back to modern Japan or something, but that never happened? It's never made clear what the magic of the key princess is actually worth (other than being protected by the crown as the last descendant of the Unification Empire) So that was pretty frustrating for me. What was the point? She also doesn't really bring any major innovation to the world being a modern person, other than a few new recipes for sweets.