Am sorry for your what you going through and hope your Child will get better soon.
As the court decided its difficult to get residence Permit through A Foreigner holding permit unless the relationship or the child can only grow up in Germany due to hardship.
Once you get Vaterschaft and Sorgerecht it will be difficult in fact and law to deport you and the child.
If your deportation has been suspended for 18 months you can apply for residence permit 25(5) A foreigner who is enforceably required to leave the federal territory may be granted a temporary residence permit if his departure is impossible in fact or in law and the obstacle to deportation is not likely to be removed in the foreseeable future. The temporary residence permit should be issued if deportation has been suspended for 18 months.
A temporary residence permit may only be granted if the foreigner is prevented from leaving the federal territory through no fault of his own .
Also 2nd option will be residence permit 36(2) since the father of the child is having Aufenthalt erlaubnis and raising a German child.
But you should be to show that if you are deported the child will face extra ordinary hardship like wont get treatment in your home country or wont be able see the father.
I think you can qualify for residence 25(5) or 36(2) once you get the child passport,birth certificate,sorgerecht and vaterschaft.
I think its better you get a Lawyer or visit refugee ctr for consultation