Robots break. All the time.
Robots need recovery when they break. They also need preventative maintenance. Even a fully automated fab has an army of technicians in there turning wrenches 24/7. In fact, the more automated the fab, the more people you need turning wrenches. So you can't have a factory that's a toxic swamp inside so long as it's clean on both ends, because there are people in there. You really don't want to ask them to wear SCBA gear all day long either. Nobody likes that. It's hot, it's uncomfortable, and it doesn't work well in tight spaces.
but nobody answered the question - are the normal outputs of a factory also toxic, or just what goes on inside? would a robotic factory even "solve" the issue?
https://en.m.wikipedia.org/wiki/Electronic_waste_in_Guiyu
That is to say, one would need proper recycling in order to avoid toxicity for the entire life cycle of products.
Also, a question for you: if chip factories were black boxes with robots in them that you put stuff into and got stuff out of, is the "output" also toxic? (Are the actual boards and such also toxic)? Or could the output be non-toxic as long as waste was handled properly, so that it's only toxic inside but neither in its waste output or product output?