Why does my lighting create square boxes at sharp angles?

See image below.
Not using anything fancy; just a basic terrain with a directional and point light.

I’ve spent weeks on this problem and can’t find any information on the internet or anyone else with the same problem, but it happens to every light that I use close to a flat surface.

I just want a normal light and shadow effect.

I’ve experimented with camera clipping planes and moving the camera.
Also note the Camera Preview is different to the game window.

Here are 3 images with the same settings, I’ve just moved the camera closer for each one:

(this is probably related to shadow distance, with shadows not drawn far away from the camera; thus this problem seems to relate to shadows rather than to the light itself)

As a temporary fix/hack I have created a plane 0.2 in front of the flat area of the terrain and turned off shadow casting for this plane.

Now the flat surface receives smooth light and smooth shadows from the terrain.

Unfortunately this creates a hard line where the plane meets the hills, but I guess this is unavoidable.