Morph Geometry to Surface

Hi, I have a 3D lattice which I am trying to fit to a range of surfaces. However, sometimes it works and others it doesn’t. The top image is it working on a curved panel but a more dome-like curvature doesn’t generate an output in the script. I’m not sure what I need to alter

to get more frequent success. Lattice Surface (283.8 KB)