I'm looking for a classic science fiction story where a man disguised as a robot is send to investigate a robot uprising on a mining/factory planet.
He is found out to be a human and brought before the robotic overlord of the planet who offers a deal, we will not kill you if you pretend to be a robot for the rest of your life. He agrees.
He later finds out that in fact all the robots on the planet are humans that made similar deals. We all think everybody else is a robot, but in fact nobody is.
Possibly from Lem or Asimov.