Pythom Error: 1. Solution exception:NoneType is not iterable

Dear all, as in the photos attached we are trying to integrate pyramids in the organic landscape and transform the 3D model to polyline for CNC machine.
when I try to change the height or scale of the pyramids some times the python code doesn’t work and sometimes it works !! however I get this error : 1. Solution exception:NoneType is not iterable
although I tested the list several times and it is not empty The grasshopper file is organized in groups and the group with the python error is named : Projected Points on Pyramids.
Best Regards
Karim


Problem_KY.gh (29.2 KB)