Dear Gentle james,
Welcome back to the Wefugees Community and thank you for sharing your question.
It is hardly possible to discuss your child's and its mother's situation without knowing the exact circumstances and details. As you are not holding a residence permit either, your child can not apply for a residence permit as child of someone legally residing in Germany. You mentioned that you applied for a residence permit? On which foundation (section of the law)? Also, did you officially recognize the fatherhood/paternity (Vaterschaftsanerkennung) and are you actually taking care of the child?
I would highly recommend your child's mother to get individual support in a refugee/migration counselling office first of all to dicuss the next steps. Please let us know if she needs support in finding one close to her location.
Please also don't hesitate to get back to us if you want to discuss your situation further or if there are any questions.
All the best,