This is such a horrible situation for all involved. Understandably the birth parents and blood relatives want to have the right to raise their kids especially when they clean up their act and find themselves in a better place to raise their kids and make things right for their family.
On the other hand I imagine it has to be heartbreaking to foster a child who was unwanted or removed from an abusive situation and raise them for several years like your own only to have a court come in and tear that child that you were raising and caring for away because you're not their real parents.
The whole thing from both sides is just awful.