Shader parameter change not persisting in resource / getting lost after refreshing inspector

Godot 4.6.2.stable
I have this small custom class for testing:

@tool
extends ShaderMaterial
class_name TestShaderMaterial

func set_shader_parameter_persistent(parameter_name : String, value : Variant) -> void:
    set("shader_parameter/" + parameter_name, value)
    
    emit_changed()

I am calling set_shader_parameter_persistent from an autoload, always with a Texture2DArray. When it gets called, the inspector seems fine with it, everything updates as I’d expect, and the shader starts sampling the TextureArray, but when I do anything to refresh the inspector, my change is lost. It just forgets I ever set that parameter. It’s quite frustrating. The change is never saved into the material’s .tres file either. Does anyone have a clue what could be going wrong? I really need this to work for a project.

Ok, update:

It seems that using standard ImageTextures for this does work. I have no clue what the distinction is between ImageTextures and Texture2DArrays that causes this. I’ll be digging through the godot source a bit to see if I can find the culprit.