Dear @Mumin,
Welcome to the Wefugees Communtiy and thank you for reaching out to us.
I can imagine that it is quite frustrating not being allowed to do anything (except of studying the language as good as possible I guess).
We discussed similar situations a few times on this platform before. Maybe you want to check out this thread or also the answer given here.
Unfortunately, the decision to grant a residence permit for a father of a child having a residence permit in Germany is indeed at the discretion of the immigration office. Therefore, it can get quite complicated. I think you did good seeking support by a lawyer. Of course you can apply for a Duldung (I think the lawyer should also do it for you), but the issuing, again, will be at the discretion of the immigration office. They will assess whether there are reasons against a potential deportation.
I am sorry that I can not give you a more meaningful/positive answer.
All the best for you and please don't hesitate to keep us updated or to get back to us with any further questions.
Regards,
Meike