Diffraction pattern not on focal plane

In recent lab course we examined diffraction of light. We used a laser with $$\lambda=510$$nm. The light passed the diffraction grating then was mapped by a lens (distance grating- lens=$$2f$$) onto the intermediate image plane where we adjusted an aperture. Then the light passed another lens (distance aperture- lens=$$2f$$) with same focal length and the diffraction pattern was recorded by a CCD camera.
So far so easy.
My problem is that the diffraction pattern wasn't captured in the focal plane, i.e. at distance $$f$$ from the second lens but at a distance of almost $$1.5f$$. I shall explicitly explain why this happend but I have no idea.
We moved the camera along the optical axis but only got a sharp pattern for the mentioned distance, so I thought of the resolution, meaning that I calculated the distance where beams of a certain diffraction order would cover a certain amount of pixels but came to no result consistent with what we measured.
Does anyone have an idea?\

Edit: What I meantioned as grating was in fact an element consisting of several gratings with different spacings aligned in a row. So the aperture was used just to select anticipated areas, i.e. a certain grating.

• Can you sketch out the experiment? Commented Jun 28, 2022 at 16:28
• I did. The experiment was meant to be an analogy and preparation for a part using the TEM and it was really just what I described. Commented Jun 28, 2022 at 16:45
• Assuming your illumination is collimated, have you tried to place the grating and aperture at distances $f$ (not $2f$), i.e., in the front and back focal planes of $L_1, L_2$, resp.? Commented Jun 28, 2022 at 18:31
• @hyportnex I've thought of different constellations. But the task explicitly says that I have to put the aperture in the intermediate image plane and to have a magnification of 1, hence $d_{object}=2f$. Commented Jun 28, 2022 at 18:51
• I thought you wanted to do this en.wikipedia.org/wiki/Fourier_optics#4F_Correlator Commented Jun 28, 2022 at 19:10