The For Each action is incredibly useful, but it can definitely be tricky when you’re first wrapping your mind around how it works. The key thing to understand is that when the macro runs, the For Each action assigns every item in the selected collection(s), one at a time, to whatever variable name you enter in the “For each ______” field (regardless of what the placeholder variable placeholder name may be).
In your Local__code variable case, the For Each action will take each line within it and set it as the content of a variable that is called whatever you enter in the “For each _____” field (VarName by default, but it could also be Line, SingleLine, or even something nonsensical like BlargleHopper). This variable (Line, SingleLine, BlargleHopper, or whatever) will then retain the single line from Local__code as its value for the duration of the loop (i.e. the actions you choose to run for every item in the collection you’re working with), after which For Each will move on to the next line in the collection and repeat the process.
However, if you don’t actually do something with the variable from the “For each _____” field in the loop, then no variables are actually changing from loop to loop, so it won’t produce the results you expect. The warning you saw was telling you to use the same variable name in the For Each actions to ensure that different variable contents were used in every loop.
Hopefully this (and everyone else’s answers) helps shine a bit of light on the logic behind it! If you want a little more information, you can always check the For Each wiki page: https://wiki.keyboardmaestro.com/action/For_Each