Is this law only an approximation for object distances much bigger than focal length (which is of course the "regular practical usage"...)?
Yes. The simple formula assumes that magnification approaches zero as object distance approaches infinity. As object distances grow smaller, the Magnification factor increases and light is lost due to the increased magnification.
If your (original) diagram uses the same linear scale on both the x and y axes, then your thin lens has an entrance pupil over twice the focal length of the shorter focal length lens and approximately the same as the focal length of the longer lens! So you're talking about f/0.5 and f/1 lenses being used at more or less macro distances!
Even with your modified drawings, you're still using very wide aperture lenses at macro distances. At your specified object distance, the magnification for lens FL1 is 0.25X and the magnification for lens FL2 is 0.67X.
The simple formulae for calculating exposure all break down at macro distances. This is due to the fact that the point of convergence at such short object distances is significantly different from the lens' focal length. These differences are not considered in simple formulas such as N=F/D, which also assume more or less infinity focus, just as the focal length of the lens does.
For more typical object distances, the difference is practically negligible. But at very short object distances the differences are significant. At full 1:1 macro reproduction ratios, the object distance is four times the focal length, and the distance from the center of a single thin lens to the point of convergence is twice the focal length of the lens (measured at infinity). Thus, at twice the distance from the lens to the film or sensor, the light is spread out over an area four times greater than when the object distance is infinity and the distance from the lens to the point of convergence is the focal length.
The actual amount of light you'll record for any image can be calculated by multiplying the amount of light you'd get at infinity focus times 1 / (1 + M)^2 where M is the magnification ratio. Another way of stating it is that the "effective" f-number is equal to N(1 + M) where N is the f-number and M is the magnification factor.
When you're taking a photo of a very large object at very great distances, the reproduction ratio is very low. You're fitting a mountain one thousand meters tall onto a film or sensor 24mm in height. That's a reproduction ratio of 41,667:1 or 0.000024X. So 1/(1+M)^2 is 1/(1.000024)^2, or 0.999952. You're only losing 0.0048 percent of the amount of light you'd have at infinity.
At 1:1, this is obviously much more significant. 1/(1+1)^2 = 1/4 = 0.25. Compared to infinity, we're losing 3/4 of the field intensity of light when the reproduction ratio is 1:1 or magnification is 1.0X.
It works out the same in terms of "effective aperture": N(1+1)=2N. When you double an f-number, you're two stops darker, or at 1/4 the field intensity.
Your f/1.0 lens has a magnification factor of 0.67 at an object distance of 10: 1(1 + 0.67) = f/1.67.
Your f/0.5 lens has a magnification factor of 0.25 at an object distance of 10: 0.05(1 + 0.25) = f/0.625
The ratio of the two "effective apertures" is 2.672:1. The square of the ratio is 7.14, which is what you approximately measured as 1:7.1.
In the real world, if we set a goal of less than 1/4 stop of light loss, we need to hold the reproduction ratio to below around 11:1.
To get the exposure difference that you seem to expect, at such short object distances you need to use the same reproduction ratio for both lenses, not the same object distance. In other words, if FL2 is twice the value of FL1, then the distance of your arrow for the longer lens should be twice the object distance used for your shorter lens.