Its gona take a shit load of a long time for robots to be even close lol. I work with these machines enough to know how advanced it is. We arent even 30 years close to them being even able to troubleshoot themselves, let alone repair or reprogram. Automation works because it is dumb and effective because it is focused. Until we can make proper Androids, repairing a machine is too complex of many tasks at once, it is manual labor, electricity and electronic troubleshooting and programing. The robot repairing the other dumber robots would be even more complex and even more prone to need repair on top of it.
The smartest thing we have in industrial automation right now are semi auto programming machines. For example an Arm, that instead of doing old school programming to tell it exactly how to take optimal movement for its given task. You can give him only the locations you want him to move to and he will do the math of how to best get the movement done himself. Its not 100% all the time, but its the best we have right now, saves a shitload of programming time (except the arm still gotta be programmed to be able to program its own path obviously). But after this one software is made, you can now simply give him multiple task without too much programming.
The problem with repair and robots, is that for now and a long while, AI and robots are 100% programmed by people to do things specifically. Robots can only work in context they are designed and programmed for. The basis of the hardest repairs are often that something unexpected happened, hence, if its not expected we did not program it. Until you have a full android with an AI that can act and pick up tool and use them in unexpected way, something we are very far off, Robots cannot repair themselves. They could maintenance themselves to some degree, but again if something is unusuale and the robot is not programmed to see it, he will not see a potential problem during its maintenance, while a real person or a full AI might deduce that an unexpected problem might be arriving soon or a situation might look unsual but the experience and reflection of a real person or a full AI might say this is currently still in a working state even if its not standard. While a simple robot will not be able to do any distinction.