Some clarification for the LUX b2b
If you're off the plane first, the member of airport staff will call security who will come down and let you through the transfer doors for the security check.
One of the police border guys will come out the back of his passport checking box and give your passport a once over before waving you back through to gate 5 for boarding.
The whole process took slightly over 5 minutes.
They are in the process of installing the automatic passport gates, so the transfer route should become easier when they go live in the next few weeks.