Raycast2D hits itself?? (Simple)

Hello,
So I have an empty 2D scene with just a gameObject (Obj1) in it, which has a BoxCollider2D and this code:

RaycastHit2D hit = Physics2D.Raycast(transform.position + new Vector3(0, 0, 1f), transform.position + new Vector3(0, 0, 1));
        if (hit.collider != null)
            print(hit.collider.name);
        else
            print("Null000");

It should not hit anything and return “Null000”, but it always returns the name of this gameObject (Obj1).
So, what’s the problem, is this even the right way to cast a 2DRay? (I’m trying to cast it on the Z axis in a 2D game)
Thank you!

Maybe you could have a look at this:
https://answers.unity.com/questions/756380/raycast-ignore-itself.html?childToView=869966#answer-869966

You are probably casting the ray from within the object, which means it hits the collider of its own object. So either do some math and place it outside of the object, or, seemingly, you can disable this behavior according to the posted link above.