Hi Bentraje, thanks for following up and sorry for coming late here.
I've checked your geometry and the issue is not with the algorithm, but in both cases with the geometries you're using to compute the area who don't shown vertexes being properly "ordered".
The algorithm I've briefly presented requires the vertexes to be ordered as if you're visiting them by walking on the outer edge of your n-gon or polygon in CCW or CW. It is then mandatory to generate an ordered list of vertexes before passing the data to the function to get the correct result.
62d2c929-154a-4c85-b558-af1536d3153d-image.png
In order to come out with such an ordered list I warmly recommend you to visit the following old-threads:
Get all ngons PolygonObject.GetPolygonTranslationMap() Get outer edges of each NgonBest, Riccardo