Extract Center of Rectangle

Works for me. Maybe your rectangle is invalid? If the rectangle has radiused corners, PCen (Polygon Center) will fail.

Had you posted your code, we could have looked at it.