Dear @paulo1976,
Welcome to the Wefugees Community and thank you for reaching out to us.
Unfortunately, you seem to just have missed the minimum of points needed to pass the exam. As you can read here, candidates must answer at least 15 of the 33 questions correctly (for the naturalisation process at least 17).
In this thread we discussed before, that the "Leben in Deutschland" test is not necessarily the only way to prove the "basic knowledge of the legal and social system" in Germany which is required for the residence permit according to section 25b. If you finished school here (Hauptschule, for instance) an Ausbildung, University etc., the immigration office may also accept this as a proof of that knowledge.
Otherwise, I am afraid that the immigration office (Ausländerbehörde) may ask you to repeat the test. But I actually have no idea how they react if you just missed it so closely. I think the only way to find out is to contact them directly.
I hope this helps and please don't hesitate to get back to us with any further questions.
All the best,
Meike