Get axis of bullet for rigidbody.velocity

Hello,

my script creates a bullet instatiate at the position of the player and in the direction of the ray.
so far it works but when i come to the part where i give the rigidbody of the bullet a transformdirection with vector3 it always takes the local axis of the player and NOT the Z - axis of the bullet which would be the correct axis.

how am i able to get the axis of the bullet to take for rigidbody.velocity?

 GameObject instaBullet = Instantiate(bullet, transform.position,Quaternion.LookRotation(ray.direction)) as GameObject;
      
        Rigidbody instBulletRigidbody = instaBullet.GetComponent<Rigidbody>();
        
         instBulletRigidbody.velocity = transform.TransformDirection(Vector3.forward*10);

Try instBulletRigidbody.velocity = instaBullet .transform.TransformDirection(Vector3.forward*10);