Welcome back to the Wefugees Community and thank you for reaching out to us.
Your situation seems to be a bit unusual - at least I never came across a case where someone holding a "Duldung" is getting an "Aufenthaltsgestattung" again. But that doesn't mean that this is not happening.
I will link two of our experts below also, maybe they are more familiar with those kind of procedures. In general, someone who holds a Duldung is asked to leave the country and is at risk to get deported sooner or later. The asylum case is closed and the application got rejected. An Aufenthaltsgestattung however says that your asylum procedure is still ongoing and there is no final decision on your application yet. You were mentioning an upcoming court appointment, I assume that you appealed against a negative decision by the BAMF? If the authorities indeed made a mistake and issued the Duldung even if your case is not finished yet, it is a reason to hope for another outcome though.
Regarding your general question if a Duldung can be issued twice: Of course, as soon as you don't meet requirements for a residence permit anymore, for example, the authorities might issue a Duldung again. Again, a Duldung means that you are asked to leave the country but some issue/detail is still preventing you to go for the time being.
Dear @mbeon-Christine or @mbeon-Ruth, can you add anything?
Good luck for the court appointment @Collins and don't hesitate to get back to us with any further questions.
All the best,