Also, I don’t think you set the bone weight on the Bone2D itself but instead set it on the polygon2d. The Bone2D class doesn’t have a bones property, but the Polygon2D class does and I think modifying it should fix it.
Unless you are already doing that, in which case please disregard this!