RaycastHit2D problem with PolygonCollider2D

Well i have a polygonCollider2d and i raycast all the points of polygonCollider2D but sometimes it misses the edges of polygoncollider and it doesnt return a point or it just doesnt hit the exact point i set as direction.What i dont understand is when create a direction like (polygonPoint - this.transform.position).normalized shouldnt it collide with the exact point (polygonPoint) of the polygonCollider am i doing something wrong with direction calculation or its just a bug

I reproduced a situation where most of the points targeted by raycast end up having their collider hit, but some don’t. Here is the code:

using System.Collections;
using UnityEngine;
using System.Text;

public class RaycastingDemo : MonoBehaviour
{
    const float ARBITRARY_HIGH_NUMBER = 9000.1f;

    [SerializeField] PolygonCollider2D target;

    Vector2[] targetPoints;
    Vector2 position;

    void Start()
    {
        StringBuilder sb = new StringBuilder();
        position = new Vector2(this.transform.position.x, this.transform.position.y);
        targetPoints = target.points;
        sb.AppendFormat("Raycast origin: {0}

", position);

        for (int i = 0; i < targetPoints.Length; i++)
        {
            Vector2 direction = (targetPoints *- position).normalized;*

RaycastHit2D hit = Physics2D.Raycast(this.transform.position, direction, ARBITRARY_HIGH_NUMBER);
bool targetWasHit = hit.transform == target.transform;

sb.AppendFormat("Point {0} at {1} implies hit: {2}
", i, targetPoints*, targetWasHit);*

}

Debug.Log(sb.ToString());
}

void Update()
{
for (int i = 0; i < targetPoints.Length; i++)
{
Debug.DrawLine(position, targetPoints*);*
}
}
}
I put this on a game object as its only component (except its transform) and I put a PolygonCollider2D on another game object, which had a SpriteRenderer. I ended up with a 37 summit polygon.
This is what I saw in scene view after pressing play:
[93227-raycasting.png|93227]
I wont include all my log, just somes lines:
Point 32 at (-0.2, -1.1) implies hit: True
Point 33 at (0.2, -1.1) implies hit: True
Point 34 at (0.4, -1.0) implies hit: True
Point 35 at (0.6, -0.9) implies hit: True
Point 36 at (0.7, -0.8) implies hit: False
Here we see that point 36 was not hit. Point 36, when we look at the picture is that one point where the raycast does not go right through the collider; if it touched, it would be precisely at that point and nowhere else. Another one is in the same situation, point 14, although it is hit.
I tried moving my raycast origin around. Sometimes it hit the edge case, sometimes not.
My guess would be it has to do with float imprecision. If anyone thinks I am wrong, please tell me now and tell me why. Meanwhile, you can read more about [float imprecision][2]. It might not help you, but it will help you understand what’s happening.

_*[2]: http://floating-point-gui.de/*_

From your comment:

Vector2 _dir = (_polygon*-this.transform.position).normalized;*

I would be surprised if pologon was a global position (transform.position CERTAINLY is). I suspect pologon is a local position, in model space. To Convert it from model space to world space use [Transform.TransformPoint(Vector3)][1]
e.g.
this.transform.TransformPoint(polygon*) - this.transform.position*
should give you the world-space vector between the polygon point, and the center position of the object.
_*[1]: https://docs.unity3d.com/ScriptReference/Transform.TransformPoint.html*_