Problems with foliage created with RenderingServer getting occluded incorrectly when transparent

Godot 4.4.1 and previously Godot 4.3 and 4.4

So the problem itself is that the foliage visibility range seems to shrink the closer to 0, 0(x, z) the camera is when the camera is at a certain height(the angle doesn’t seem to matter). This has happened in 4.3, 4.4 and 4.4.1.

Video example:

The code that creates the foliage if it helps:

var rid:RID = RenderingServer.instance_create() # CREATE RID
RenderingServer.instance_set_scenario(rid, get_world_3d().scenario) # SET RID SCENARIO
var idx:int = int(remap(deco_manager.noise.get_noise_2dv(pos+Vector2(5,0)), -1, 1, 0, type.variant_bases.size()-1))
RenderingServer.instance_set_base(rid, type.variant_bases[idx]) # SET RID BASE
var height:float = deco_manager.map_manager.get_height_at_true_position(true_point)
#print(height)
var trans:Transform3D = Transform3D(Basis.IDENTITY, Vector3(pos.x, height, pos.y))
trans = trans.scaled_local(type.variant_scales[idx])
RenderingServer.instance_set_transform(rid, trans) # SET RID TRANSFORM
var aabb:AABB = AABB()
aabb.position = -type.variant_scales[idx]/2
aabb.size = type.variant_scales[idx]
RenderingServer.instance_set_custom_aabb(rid, aabb) # SET BLOWN UP AABB
#RenderingServer.instance_geometry_set_lod_bias(rid, 128.0) # DOES NOTHING
RenderingServer.instance_geometry_set_visibility_range(rid, 0, 300, 0, 25, RenderingServer.VISIBILITY_RANGE_FADE_SELF) # SET RID VISIBILITY RANGE
#RenderingServer.instance_geometry_set_cawst_shadows_setting(rid, RenderingServer.SHADOW_CASTING_SETTING_DOUBLE_SIDED)
RenderingServer.instance_set_layer_mask(rid, deco_manager.deco_mask) # SET CORRECT RENDER LAYER MASK

Thought I’d update this thread since the problem is persisting.

I changed the terrain from a vertex shader to a mesh that gets built at game start and is split into chunks.
I think I’ve narrowed the problem down to some sort of problem with the engine occluding the foliage when it becomes transparent. When I decrease the sorting offset of the terrain chunks enough the foliage reappears but I don’t think messing with the sorting offset is a good solution.

Also I’m confused why it only happens in the world space Right direction.
Edit: correction Right direction only instead of Right, Back