Circle2D intersectsLine does a dot product to determine closest point on line but then filters it like this:
If magnitudeAB (squared length of line) is less than 1 (degree), this will always return false.
distance is actually the "t-value", meaning the correct behaviour here would be to clamp it between 0 and 1 to ensure point is on actual line.
A straightforward fix that works since edge and end points are checked anyway:
This is tested and verified by building version 8.8.0 and replacing jar-files in an elasticsearch instance of version 7.12.