Generally in such situations, it is required to leave the country and return with the correct visa.
An exception can be made for parents of young children. As young children are unable to understand a long absence from a parent, in such cases it can be seen as unreasonable to require the parent to go through the visa procedure.
There is no clear definition of how long an absence is acceptable and until what age a separation is considered unreasonable. If the Ausländerbehörde persist in requiring you to leave the country, you can take the case to the administrative court (Verwaltungsgericht). However, be aware that there have been different court decisions on this matter. You need to discuss in detail your options with your lawyer.
Has your lawyer made this point to the authorities? The rule is in paragraph 5, section 2, number 2, part 2 of the Aufenthaltsgesetz.
This article (in English via an online translation) gives a good overview on this issue:
I also previously answered a similar question here: