Invalid Cast

I am trying to fit in a TPMS geometry (gyroid, schwarz etc) into cylinder. I am giving the constructed tpms into basic cylinder as topology. But I am getting an error ‘invalid cast: mesh >> unitcell’
image

can’t help you without a gh file

Gyroid.gh (13.0 KB)
I now want to fit this gyroid in a cylinder, basically make a cylindrical flow pipe with gyroids packed in it