This is not an economic move for the company. They are better off hiring a new CS grad, and if her pay wasn't reduced they are better off with a senior engineer. An action like this is literally an act of charity. People go through a lot to learn dev skills and she is being handed these skills as a gift.
What I'm going to say next might come off as a bit sexist and keep in mind it's just representative of my own anecdotal experiences and others may have completely different experiences.
I have found that when a female developer isn't doing so well on her job she's given a lot more leeway then a male developer. Additionally a lot more people (men) will go out of their way to help her because of her sex. Part of the fact she was even offered a role as a developer very likely has to do with some aspect of this.
Frankly, I can't see this same situation happening as often for a dude. Men are subconsciously judged more for their competency while women (especially attractive women) trigger good Samaritan vibes, making competency take a back seat while people do everything they can to foster a community of help and assistance.
Nothing wrong with taking advantage of it, but if I was a janitor in an engineering company and I asked the director for a starring role as a SWE they'd look at me funny. But if I was a really hot female... I can see the possibility of a director trying to establish himself into a mentor-ship role.
I'm not implying men do this consciously. I think most men and people in general like to think of themselves as non-biased so most of this happens as subconscious actions.