Dear
@Jafar,
thank you for sharing your situation with us in the community. I am very sorry to hear about the issues arising.
But as for your question, yes once you have proof that it is your child and you have claimed shared custody then you can apply permission to stay due to a german child.
I hope I could answer your question, if you have further question please do not hesitate to ask the community.
Best regards,
Nilab