What is the relationship between perceived difficulty and mistakes/errors? I'm looking for any empirical research about the correlation between the perceived difficulty level of humans and the mistake / errors they make while performing a task. 

I would prefer studies with longer/more realistic tasks compared to simple task performed in the lab. I would also prefer studies in the field of software engineering.

So far I could only find one study in this direction:

Varying task difficulty in the Go/Nogo task: The effects of inhibitory control, arousal, and perceived effort on ERP components

Are there others with longer/more realistic tasks?
Here is an article that seems to describe what you are looking for. The researchers sought to test factors that influence the performance of software engineers. To quote from the abstract:


  Goal difficulty has a negative relationship to performance but a positive relationship to effort. Because of this off-setting effect, the degree of goal difficulty has a relatively small overall effect on performance. Goal clarity also has a relatively small effect on performance. Individual ability has the strongest direct effect on perceived performance, more than twice as strong as the effects of work effort, personality dimensions, and perceived characteristics of the task. High achievement needs were directly related to both effort and perceived performance, whereas self-esteem and locus of control have a direct relationship to perceived performance


In summary, it looks like an increase in perceived task difficulty lends itself to an increase in effort, but not overall task performance. Perceived performance is strongly tied to the individual's self-esteem and locus of control.

EDIT: I forgot to mention this in my original post, but you might find it useful to know that there is also research on effort level relative to task difficulty. This study assigned computer tasks that ranged in difficulty, and then gave participants high or low levels of reinforcement for performance on the task. The participants then were given an anagram task to measure performance.


  ...individuals who were highly reinforced for performance on the low-difficulty computer task spent less time persisting on the subsequent anagram task, demonstrating that the low level of effort generalized to another activity. Additionally, individuals who were given low levels of reinforcement for performance on the moderately high-difficulty computer task spent more time persisting on the anagram task. This demonstrated that the effort exerted on the first task, paired with low levels of reinforcement, generalized to the following task. However, participants who were given the highest-difficulty computer tasks did not generalize this effort. According to the researchers, this version of the task was so difficult that the participants could not succeed and thus demonstrated a pattern of behaviors similar to learned helplessness.


1