Thanks for sharing the .dyn file. I tested it and by my side, it is working well. What you should do now is to understand where happens this loss of data that make the 2 lists different in size.
Since we already solved the list managing useful to create the composition of strings you were looking for, the post is becoming a bit of an off-topic.
Anyway I will suggest you another way to extract the material name and replace the node that gives you the error:
the code inside the PythonNode is:
from Autodesk.DesignScript.Geometry import *
# Import DocumentManager
from RevitServices.Persistence import DocumentManager
# Import RevitAPI
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
collect = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsElementType()
# Extract walls' layer material
out = 
errors = 
for w in collect:
CompNr = w.GetCompoundStructure().LayerCount
out.append( [doc.GetElement( w.GetCompoundStructure().GetMaterialId(i) ).Name for i in range(CompNr)] )
except Exception as e:
OUT = list(collect), out, errors
As you can see, there are 3 lists coming out from the python: The first is the collection of all the wall type in the project, second is the name of the layers’ material (per each wall type) and the fourth is a special list I created for you that will collect all the wall type which materials have not been exported.
Clockwork nodes are really amazing but this is a code more customized for that situation that helps you to understand the errors and work with cleaner lists.
This last list is a composition of lists of 2 elements, the first representing the wall type that produces the error, the second describing the error itself.
p.s. note that errors can be related to the attempt of extracting material from a Curtain Wall or extracting the name of a wall’s layer material not defined (the ones)