EgdeCollider2d.CLosestPoint keeps return wrong results

I have a prefab with a LineRenderer that does not use world space, and an EdgeCollider2d.

I need to get the closest point on the collider to the position of the player. The transform.position of the player must be world coordinates, since it is a direct descendant of the scene.

The transform of the line game object must also be world coordinate since none of its ancestors were transformed (shifted or resized).

My code is osmething like this:

Vector2 closest = lineObject.getComponent<EdgeCollider2D>().ClosestPoint(player.transform.position);

The problem is that as I began printing in the debug log thsi resulting position, I realised this point is not exactly on the collider.

Very rarely, the point was just on teh edge of the line, sometimes much away from it, sometimes it was on the other side of teh line (how coudl it even be considered closest?)

The points of my EdgeCollider2D match the points I specified in teh LineRenderer, also I tried setting an array of different values for the radius of the collider, but no results.

I tried a lot of local to world space conversions and none of them worked:

EdgeCollider2D coll = lineObject.GetComponent<EdgeCollider2D>();
Vector2 closest = coll.transform.TransformPoint(coll.ClosestPoint(player.transform.position));

I even tried the following:

EdgeCollider2D coll = lineObject.GetComponent<EdgeCollider2D>();
Vector2 closest = coll.transform.TransformPoint(coll.ClosestPoint(coll.tranform.InverseTransformPoint(player.transform.position)));

No results, at all, iti s driving me mad. I actually get points that are so so close to teh collider and they are always within a maximum error but this error is pretty huge in my opinion.

Screenshot 2023-08-23 at 0.33.20

In this screenshot, the point where you can see the pivot of teh gameobject, is the point returned by CLosestPoint, which is pretty far away from the line in orange. This is teh result I get, when teh radius of teh collider is already just half of teh widht of the LineRenderer.