The line missing is '&request:LU-NE-Id := 2' - between "--> &request:LU-NE-Id := 2" and "EXPAND %{map:%{Foreach-Variable-0}}".
Where does that line come from? I don't think that the default is to print out bare attribute names to the debug.
I'm now sure this occasionally missing line is normally output by the map xlat (map_debug_log called by map_to_request called by xlat_map), well after '%{Foreach-Variable-0}' has been expanded.
I infer that the value of "&request:LU-NE-Id := 2" is not being returned from the expansion properly and thus map is being passed an empty string.
Maybe... you'll have to instrument src/main/xlat.c in order to walk through the various expansions to see both their inputs and outputs.> Also, what's "%{map: ..}" doing? Is it your custom module, or is it a standard module?
It's the standard core's map xlat. I'll continue slowly winding my way down the stack. Graham