Assume in a convolutional layer's forward pass we have a 10x10x3 image and 5 3x3x3 kernel, then 10x10x3 * 3x3x3x5 has the output of dimensions 8x8x5. Therefore the the gradients fed backwards to this convolutional layer also have the dimensions 8x8x5.

When calculating the derivative of loss w.r.t. kernels, the formula is the convolution $input * \frac{dL}{dZ}$. But if the gradients have dimensions 8x8x5, how is it possible to convolve it with 10x10x3? The gradients have 5 channels while the input only has 3.