I'm running in to the same issue using Figma and creating a custom icon. I try to create the different weights by adding a stroke to the custom icon and then outlining the stroke and flattening the icon. If I just add the icon in to the different weight groups without editing it then it works fine and validates. It's once I start editing the icon and try to make it thicker or thinner that I think it doesn't work. If you figure out what the solution is let me know.