Welcome to the Wefugees Community and thank you for reaching out to us.
It is quite difficult to predict, what exactly the immigration office is "offering" now. Especially as we know very little about your conditions. Did you apply for asylum? Was the application rejected? You were mentioning the court - did you appeal against the rejection?
If your baby's father holds a permanent residence (Niederlassungserlaubnis) for many years, the child might also be able to get the German citizenship, if I am not mistaken. You may be entitled to receive the residence permit according to Section 28 of the German Residence Act respectively as mother of a German child. Otherwise, your child can get a residence permit according to Section 33 of the German Residence Act as child born in Germany (and a parent holding a residence permit). For you, a residence permit according to Section 25 (5) could present an option.
I will also link our dear expert @alla_fka here. Maybe she can correct me or add some information.
In any case and the most important aspect: They will definetely not deport you without your child! Please don't be afraid that the authorites seperate you. This is very unlikely to happen and for sure not in the authorities' interest.
I hope this helps and please don't hesitate to get back to us with any further questions and/or if you want to update us.
All the best,