The problem with this is that a factory making stuff is useless if people don't want or can't afford the product. The Marxist labor theory of value asserts that value s created when something is made rather than sold, but 1000 pairs of shoes sitting in a warehouse miles away from any consumers who might want to wear them aren't making anyone better off.
More accurately its that the value is set by the labor required.
Beyond that for most people in a capitalist system, the basic process was one of commodity > money > commodity. Meaning that people made stuff to earn money, to buy more stuff.
But for the capitalists instead it was money > commodity > money+. Putting money into the production of stuff so as to earn even more money on sales.
Now where Marx went off the rails was with factory machines. He was sadly working under the preconception that workers were being exploited, and so ended up badly muddling the impact machinery has on the value definition.