#11489: Fix polygonCentroid for invalid polygons