Mesh split by mesh naked edges does not work with holes (using Python)

Base mesh:

Mesh to project:

What I obtain. Item 1:

Item 2:

Does anybody know how to do this in a good way?
MeshSplitByNakedEdges.gh (1.1 MB)

Looks like someone took this script and stripped my name from it. It was written for that case (i.e. a mesh with only has one naked perimeter). Hence you will need to use all the naked edge loops and not just the first one:

Yes, it was me. Notice that I am also the creator of the other thread. I removed your name because I am using it in another script. I hope you haven’t got upset about that

Thanks, I’ll give it a try

Edit: I upload the solution for for anyone who might need it
MeshSplitByNakedEdges_solution.gh (1.1 MB)

No worries. I would have continued the existing thread. Or at the very least have provided a link/reference to it.