A bit late to the party, as usual
Bumped into the same issue, building a gear, with gear’s inner hole.
The Gear itself:
The solution was exaclty what @PavelBoytchev said - not to close the path.
In my case, I simply built a set of points in circular formation, missing the step, where angle is exactly Math.PI * 2.