Let's say I have an almost perfect metronome which ticks at 60 beats per minute, except for one beat that is slightly off from time to time. What's the maximum error this metronome can have without a human being able to notice the rhythmic default? Is there any study related to that? Also, would it depend on the metronome speed?
There have been studies on this, both with paired clicks and long streams of clicks. Normal listeners can detect changes of the sort you describe with essentially perfect reliability down to about 45 ms and with better chance performance below 30 ms. I haven't been able to find a study measuring the minimal threshold for this change, but from the studies I have found it should probably be in the 10-20 ms range.
As for how the interval affects it, the answer depends on the direction of change and the direction of interval change, so it is hard to give a single answer. The affect seems to be larger at larger interval changes.
Note that this is a very low-level task, with slightly higher modulation rates processed at the very lowest levels of the auditory pathway. It is also a task that is highly "conserved" evolutionarily, that is it is very consistent across species. Fish have similar performance to humans at this task. And not that in the stream study, it used mismatch negativity, which is a change in electrical activity in your brain that occurs even if you are not paying attention to the stimulus and don't consciously notice the change.
From mental chronometry studies, I would venture that 160 - 190 ms would be a reasonable lower limit for the deviation of a beat for a trained subject( i.e the time it takes to process the stimulus), the upper limit is somehow harder to estimate...
What's the maximum error this metronome can have without a human being able to notice the rhythmic default?
Depends in general, the ability to discriminate a deviant beat in a set I believe is a learned behavior, so it could vary from individual to individual and training. Beat matching comes to mind, it takes a DJ anywhere from months to years to accurately tell by how much 2 songs beats are out of sync and to match them.
would it depend on the metronome speed?
By speeding the metronome you are reducing the time in between ticks, so you are effectively making it harder to detect the deviation, (this also implies you are increasing the bpms).