Game object not registering raycast when rigidbody has it's position freezed

So, i have two objects, one is raycasting for the secon one (raycaster and target). The problem i have is when i set any costrains to target, no matter if it is position or rotation the raycaster isn’t “finding it”. Raycast works fine when there are no constrains.
6192564--679089--upload_2020-8-11_19-2-50.png

Here is also my code:

    private void CheckRaycast()
    {
        Ray ray = new Ray (transform.position, transform.forward);
        RaycastHit hit;

        if(Physics.Raycast (ray, out hit, maxDistance))
        {
            if(hit.transform.GetComponent<Interactible>())
            {
                Debug.Log("Hit int");
                SetIntScript(hit.transform.GetComponent<Interactible>());
            }
            if(hit.transform.GetComponent<Interactible>() != intScript)
            {
                Debug.Log("Hit but no int");
                Exit();
            }
        }
        else
        {
            Debug.Log("No hit");
        }

Help me i have a similar problem :C