Hello @Jeff and welcome back to Wefugees!
Firstly, it really is a great achievement to successfully complete an apprenticeship (Ausbildung)!
I'm sorry to hear that your friend's asylum application was rejected again. But it sounds like there are some opportunities in the future. Either way, it will be important to get a passport. Why is it that he can't submit a passport? Has he really tried everything? In any case, it is important that he documents his efforts well and presents them to the relevant immigration authority (Ausländerbehörde).
It is difficult to judge from a distance (without knowing too many details about the case). But here are a few thoughts on possible options:
If your friend came to Germany before 31 October 2017, he may still be able to apply for the so-called "Chancen-Aufenthaltsrecht" by the end of 2025 (according to §104c AufenthG). However, one prerequisite would be that he also has a "Duldung" when he applies (has he already received this?). This residence permit according to §104c would also give him another 18 months to get a passport and then change to a residence permit according to §25a or §25b (you can also read the detailed requirements at Handbook Germany).
Theoretically, he could probably already get one of the two residence permits now. After all, he is working and earning a living. However, he would have to present a passport or prove so well that he has really done everything reasonable, at least prove his identity with further documents and convince the immigration authorities that he is a kind of hardship case so that they make an exception (this is really very difficult).
There will be similar problems if he wants to apply for a residence permit according to §18a for skilled workers (after all, he is a skilled worker/"Fachkraft" with his completed training). The immigration office will certainly ask for his passport.
As you can see, his options depend on many factors. Every case is different and I would always recommend that your friend seeks support from a counselling centre.
I hope this helps and please don't hesitate to get back to us with any further questions.
All the best,
Meike