I have run into the same issues myself.. not sure if there's any way to fix, considering the same issue occurs (to a lesser extent) with assembling machines being used for speed module production. If an item can be used for the crafting in a machine, it will be prioritized over using modules... as modules. I think the only way to get around this is by making a blueprint of a machine with modules pre-inserted, and letting the bots place it.