Cannot reproduce the issue here on linux, but have the feeling windows builds are much more easily broken with referencing bad data from bpy. So here guessing direct loop over bpy.data.xxx when you do add and remove stuff from said xxx inside the loop is not a good idea - which seems logical in the end. :P