What is the name of the profession of creating factories/production lines?

As Murphy said, “if there’s a right way and a wrong way to do something, some fool will invariably choose the wrong way.”.

Yes, Murphy was a real person, an engineer on Col. Stapp’s acceleration project. And yes, that was the original form of Muphy’s Law. The point isn’t that something will always go wrong; it’s that you should design things so that there isn’t a wrong way, so that fool will never have the opportunity to make the wrong choice.

I have a CPIM (Certified in Production and Inventory Management) certification from APICS (American Production and Inventory Control Society) that took about a year to get. The field of study, supply chain management, is vast and multifaceted. From engineers to demand management to master planners, materials planning, lean systems, quality systems, maintenance, etc. etc.
My current niche is managing a $4million spare parts inventory for all the lines in our facility but I work with dozens of people in all these fields.

Since the original question focused on a line of toys, if you’re using plastic/rubber extruding machines you can change the mold and do other modifications so that you can do one toy on Monday, another on Tuesday, etc.

If you are interested in quick changeovers, I suggest you look into SMED, single minute exchange of dies. Master Unit Dies makes mold inserts that can be changed with loosening four bolts, sliding the mold inserts out of the base, slide the next one in, slide the clamps over and retightened.
Add four waterlines with quick disconnects like the ones made by DME, Detroit Mold Engineering, and you can switch from one part to another in a single minute ( less than ten minutes).
That is assuming same material, same color, if you need to purge the screw and barrel, changeovers take longer.
World class manufacturers measure changeover time from good part to good part.

Getting my bachelor’s and master’s in ME and Aerospace, respectively, I too knew IE’s as “imaginary engineers.” So cocky was I. And totally wrong, at least, at the PhD level.
I’ve had to learn a lot from IE techniques in discrete optimization and its underlying math in order to advance my own Aerospace PhD. Totally different stuff from the typical Aerospace department math, but not trivial by a longshot!