Slice with procedural mesh

Hi, I am trying to slice an hollow object, like a coconut, but I have problems with the cap function, it does fill the entire half of the coconut instead of it’s borders.

Any idea how to resolve this?

Thanks