Welcome to the Wefugees Community and thank you for your question.
Unfortunately, I am not familiar with the immigration rules and regulations in Luxembourg. Therefore, I can only give information on the part of the question referring to your status in Germany. From my perspective, as long as you only apply for jobs in Luxembourg, this will not have an influence on your "Duldung" here. However, as the issuing of the Duldung is based on your Ausbildung (apprenticeship) in Germany, it will definitely expire once you leave your job in Germany for work in Luxembourg. In case you are granted a subsequent residence permit after you completed the Ausbildung ("3+2 regulation"), this residence permit will most likely also expire if you are not working in the field of your specialisation in Germany any more.
I would recommend you to double-check your options in Luxembourg and discuss your situation with experts on the immigration law in Luxembourg very carefully. You achieved already a lot in Germany and you will most probaby have a lot of options and good perspectives in Germany once you completed your Ausbildung. You may risk all this if you leave.
I hope this helps and please don't hesitate to get back to us with any further questions.
All the best,