In principle, the embassy / consulate is responsible for issuing passports. The reissue can take a few weeks.
Foreigners are obliged to report the loss / theft of their passport to the immigration authorities immediately. There you will receive a certificate of lost identity papers (with a passport photo if you wish). This is usually required by the embassy / consulate.
The theft of the passport must also be reported to the police.
After receiving the new passport, you must visit the immigration office again to apply for the new residence permit.
If the passport is found again, the responsible immigration office must be informed immediately.