I have been trying to produce hard shadows on EEVEE using a sun lamp. it looked good on the viewport but in the render, it didn’t give the same result.
these are my light and shadow render settings:
Camera is set to Orthographic type. Have you set this up intentionally?
The same thing happens in viewport if you switch to Orthographic mode (key 5 from numeric keypad).
I have no idea why shadows act differently depending on Orthographic or Perspective view. You should report this just in case.