Hi @Medi007
To have a residence permit to do a language course, you have to enter Germany with a visa specifically for a language course. You apply for this visa at a German embassy abroad.
We cannot provide legal advice here. You can go to a lawyer but I do not know what a lawyer can do for you considering you do not (based on your situation as you describe it in your question) have the right to stay in Germany.
The border crossing certificate is not just for leaving Germany but for also proving you have left the Schengen area. If you wish to send it back from another EU country, you have to bring it to the German embassy of that country along with evidence that you are staying legally in that EU country.
Best,
Éanna