So... the lord of light works in mysterious ways in order to stop the rise of the dark?My take on it was that she didn't understand all of the visions and stuff. Just an imperfect reading of the Lord of Light's intentions. Plus, she tried using them for her own ends for what she thought. It would seem to have worked out correctly only when it fit the LoL's plans.
Her real purpose was to bring Jon back to life because the alliance depended on him doing that. No one else could have. And, she helped Arya see her destiny. No one else could have done that either.