It looks like the crash is due to entity_name != item_name for miniload-inserters; the following seems to do the lookup of the item name without too much trouble:
for _,item in ipairs(event.created_entity.prototype.items_to_place_this) do
-- if more than one kind of thing is used to build the entity, don't touch this
if name then return end
-- if more than one item is used to build the entity, don't touch this
if item.count > 1 then return end
name = item.name
end
Edit: fix tyop