The CreatePolygonFromVertices function creates the body object, but does not return it.
. There should be a
return body; line at the end of that function.
The downstream issue that this is causing is that calling CreatePhysicsEditorShape({worldId, key, url}).then(body => ...) results in body being undefined.