Why do you think it is an accident? I thought evolution is an adaptation mechanism. If anything I'd say we've got a pretty cool form factor (peak human form, not like me who is out of shape lmao).
The human body has been optimized for a very complex objective function, and in a very different environment to a robot. If you specify what the robots are doing, and the set of constraints like power source, size, weights, etc., the optimal design will unlikely be humanoid.
I used the word accident to emphasize that there is no design or designer. I agree that evolution is adaptive and often creates optimal solutions.