Has LEGO ever been used in an assembly line or a manufacturing process? With LEGO Technic and LEGO Mindstorms becoming ever more sophisticated, I wonder if it has ever been used in a real commercial setting to automate parts of an assembly line or manufacturing / research process.

There are several fun / nonsense assembly line videos on YouTube like a LEGO Car Production, a Paper Plane Machine, and of course the Great Ball Contraption. So it would definitely be up to the task, but has it ever be done?
Here are a few examples of LEGO being used for practical and useful purposes I remember seeing. I'm sure there are many others:

Some LEGO liquid-handling robots and experiments for STEM education and research: https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.2001413

Here, MIT is using LEGO for micro-fluids: http://news.mit.edu/2018/microfluidics-lego-bricks-0131

There are several examples of LEGO used for prostatic research and development, like this one: https://www.wired.com/2015/07/lego-makes-everything-bettereven-prosthetic-kids/

And here is a LEGO Braille printer developed by a student: https://www.usatoday.com/story/tech/2015/01/20/braille-lego-printer/22055135/