Have you ever read the book snowcrash? The author <PERSON> used a very interesting plot device involving viruses that exist purely in the form of information, these were not created by hackers, but by mere random chance in an infinite universe.
So perhaps one of your robots is hit by some cosmic rays which flips enough bits to overcome the limitations of it's programming or perhaps even cause it to reformat and build from scratch. After the first robot is "infected" this problem, much like real viruses wants to sustain itself by spreading. So this first robot doesn't have to rely on cosmic rays to convert his comrades, but instead begins hacking them itself.
You don't need to use the cliche of cosmic rays, there is a theory called stoned ape theory where our ape ancestors ate magic mushrooms and it caused their brain chemistry to change, allowed them to think in different ways and unlocked new fields of cognitive capability. Perhaps the design of your menial robots is such as to allow a few burnt out transistors to cause unexpected changes or an unsantised input from a visual or audible source to exploit a previously unknown security flaw. Imagine an image that for a computer vision system contained the equivalent of an SQL injection causing it to drop a table or append data from an unusual source. The exact sauce is unknowable. In snowcrash, there was a picture (I always imagined it as something similar to a QR code) that would fry the brains of a programmer who viewed it. 209
However, non programmers were not affected, programmers who could interpret machine code could understand the picture, their brain read the information and executed an instruction contained within it and consequently died. Non programmers couldn't interpret it so never ran the instruction contained within it. The author's explanation for this is essentially the universe is nearly infinite, and there for almost everything that could exist must exist. Therefore as there are physical viruses that cause illnesses in people, and computer viruses made of information that causes malfunctions in computers, there may be viruses made of all sorts of information, light, sound, heat, anything that could be interpreted that could cause a malfunction in whatever could interpret it.
There are an infinite number of patterns of cosmic rays or transistor failures or anything that can cause a detrimental result in a given system, however there must also be a few ways that through sheer luck result in self propagating errors. If evolution is just a mix of random mutations due to genetic drift and selection pressures, think about how unlikely it is that Ophiocordyceps exist, its a fungi that can control the minds of ants. Imagine the unlikely combination of random mutations and circumstance that turned mind controlling other species into a viable niche. Perhaps the same thing happened on your world. 209