https://i.imgur.com/0LusXCq.png the image for example
I think you should change the behavior of input chest (outside -> inside factory), if there's item in the red section of the input chest you should accept to pass them into the factory if there's some place in the chest inside in the normal section(not the red section)
For the example I showed you, we pass basic belt to convert them into yellow belt and we product basic belt if the first place is empty. But when we want to place all the excess basic belt we've already created they wont be inserted inside the factory.
I hope you understood what I wanted to say