I fixed it myself. AI was completely wrong.
There was only one small problem - depthTexture was flipped on the Y axis, all else was right, here is a working example if someone needs it:
@Deltakosh I am not sure who is responsible for documentation, but I think it is a good idea to add this example to it, in the section:
Now it does not explain that the screen space Vector3 it expects must contain non-linear Z in [0-1] range.
But also, it is a good idea first to check this bug related to this unproject: