Why is taking the gradient of the average error in SGD not correct, but rather the average of the gradients of single errors?
The gradient of the average error doesn't always equal to the average gradient of errors. 
The source for the difference between them lies in the non-linear layers of the model.

Example:

You can easily see it in the following example with the gradient of the sigmoid function:

The sigmoid function is defined as:



It has a very convenient derivative:



We now take 2 inputs  and calculate the mean of the sigmoid's gradient with respect to them:





We now calculate the sigmoid's gradient with respect to their mean:





These 2 results are clearly not the same. If you want further proof, just calculate the numerical results for:



You will get that the mean gradient is ~0.2233, and the gradient of means is ~0.235.