1947: "With Folded Hands . . .", a novelette by Jack Williamson, the first story in his Humanoids series; first published in Astounding Science Fiction, July 1947 which is available at the Internet Archive, as is the Dimension X radio play.
Wikipedia plot summary:
Underhill, a seller of "Mechanicals" (unthinking robots that perform menial tasks) in the small town of Two Rivers, is startled to find a competitor's store on his way home. The competitors are not humans but are small black robots who appear more advanced than anything Underhill has encountered before. They describe themselves as "Humanoids".
Disturbed at his encounter, Underhill rushes home to discover that his wife has taken in a new lodger, a mysterious old man named Sledge. In the course of the next day, the new mechanicals have appeared everywhere in town. They state that they only follow the Prime Directive: "to serve and obey and guard men from harm". Offering their services free of charge, they replace humans as police officers, bank tellers, and more, and eventually drive Underhill out of business. Despite the Humanoids' benign appearance and mission, Underhill soon realizes that, in the name of their Prime Directive, the mechanicals have essentially taken over every aspect of human life. No humans may engage in any behavior that might endanger them, and every human action is carefully scrutinized. Suicide is prohibited. Humans who resist the Prime Directive are taken away and lobotomized, so that they may live happily under the direction of the humanoids.
Underhill learns that his lodger Sledge is the creator of the Humanoids and is on the run from them. Sledge explains that 60 years earlier he had discovered the force of "rhodomagnetics" on the planet Wing IV and that his discovery resulted in a war that destroyed his planet. In his grief, Sledge designed the humanoids to help humanity and be invulnerable to human exploitation. However, he eventually realized that they had instead taken control of humanity, in the name of their Prime Directive, to make humans happy.
The Humanoids are spreading out from Wing IV to every human occupied planet to implement their Prime Directive. Sledge and Underhill attempt to stop the humanoids by aiming a rhodomagnetic beam at Wing IV but fail. The humanoids take Sledge away for surgery. He returns with no memory of his prior life, stating that he is now happy under the humanoids' care. Underhill is driven home by the humanoids, sitting "with folded hands," as there is nothing left to do.
P.S. In case it matters, the humanoid robots are under the control of a central brain:
"We are all alike, Mr. Underhill," the silver voice said softly. "We are
all one, really. Our separate mobile units are all controlled and powered from Humanoid Central. The units you see are only the senses and limbs of our great brain on Wing IV. That is why we are so far superior to the old electronic mechanicals."
[. . . .]
"Naturally we are superior," it cooed serenely. "Because our units are metal and plastic, while your body is mostly water. Because our transmitted energy is drawn from atomic fission, instead of oxidation. Because our senses are sharper than human sight or hearing. Most of all, because all our mobile units are joined to one great brain, which knows all that happens on many
worlds, and never dies or sleeps or forgets."