Turn right or left, the bullets don't spread horizontally

Godot Version

Godot 4.2.1 stable

Question

when I turn right or left, the bullets don’t spread out horizontally as they should

Video:

Code

func shotgun():
	var cam_ray = get_camera()
	for i in number_of_palletes:
		hitscan_fuction(cam_ray)
		
func get_camera()-> Vector3:
	var camera = get_viewport().get_camera_3d()
	var center = get_viewport().get_size()
	
	
	var ray_origin = camera.project_ray_origin(center/2)
	var ray_end = ray_origin + camera.project_ray_normal(center/2)*weapon_range
	
	
	
	var new_intersection = PhysicsRayQueryParameters3D.create(ray_origin,ray_end)
	new_intersection.set_collision_mask(0b10110)
	var intersection = get_world_3d().direct_space_state.intersect_ray(new_intersection)
	
	
	if not intersection.is_empty():
		var col_point = intersection.position
		return col_point
	else:
		return ray_end

func hitscan_fuction(collision_point):
	var bullet = (collision_point - muzzle.global_transform.origin).normalized()
	bullet.x = bullet.x + randf_range(-recoil, recoil) 
	bullet.y = bullet.y + randf_range(-recoil, recoil)
	print(bullet)
	var new_intersection = PhysicsRayQueryParameters3D.create(muzzle.global_transform.origin, collision_point+bullet*2)
	
	
	var bullet_collision = get_world_3d().direct_space_state.intersect_ray(new_intersection)

	
	if bullet_collision:
		
		var hit = gogo.instantiate()
		var world = get_tree().get_root()
		
		world.add_child(hit)
		hit.global_translate(bullet_collision.position)
		hit.global_rotation = bullet_collision.normal