No, you're doing everything right. Unfortunately, what you're trying to do is impossible, since the inside of a factory is powered by a tertiary priority energy source (an accumulator) and accumulators don't charge each other. There's no better solution, unfortunately, because there's a tradeoff involved. You'll have to put your accumulators outside with your solar panels.