With you....this illness is so baffling. Well done on doing what you needed to do for your d on her journey so far. Echoing all the great advice so far.
I am still in the midst (so I'm not necessarily coming from a position of great strength here) but we had a similar-ish situation in that my d (16 then, 17 now) was in a psych unit first, then transferred to ED IP and quite quickly wanted out of IP and was soon eating much better at home with me when on leave than in IP. She was not mentally restored but motivated enough, WR and it was clear she was better at home and was discharged after only 3 months (the last month she was mostly at home anyway.) It was right for her to come home in our case and even though it has not been plain sailing, I'm glad she came home when she did. We felt she needed to pick up life before 18 and she was in a position enough to have a go with our support.
So, just a few qs. Sorry for them, it just might help understand and think through possible next steps...
1st steps - can she come home for bits at a time?
What does ED unit say about her progress?
What does your d think will be different this time at home?
Can you use this willingness as leverage...e.g. yes, I want you home but your safety is paramount so you'll see how it goes over extended periods at home. There are clear expectations, no negotiations over food etc.
Personally, I think it is possible that the IP inpatient experience could be deeply upsetting and demoralising and it is potentially good she wants to come home. At the same time, it's good to have a strong plan, expectations for compliance and relapse prevention strategies with clearly spelled out consequences for non-compliance in terms of food, therapy (if useful) and any medical monitoring. It can't be that coming home is the easier option in terms of restricting and opting out of monitoring/medical care.
All the best to you as you work this through...