I think the rationale is that they are already using typical car factory automation, but they see a huge potential market for general purpose robotics in the coming decades, they don't need the humanoids, they are simply dogfooding a future product.
I think this is smart and not very risky. Tesla is playing a similar game with Optimus, for now Hyundai/Boston Dynamics is at least 5 years ahead.