Reflecting read only properties in script

Godot Version

4.4

Question

When accessing Node properties in script via get_property_list(), how best to detect if the property is read-only?

The use case is a script-based batch duplicator of scene files. For each dupe it scans an input dictionary of property names and values and tries to write those onto a newly-instantiated node. However, if the property is read-only it will throw an error. The property in question is one from a custom class authored in native with a getter but without a setter, making it effectively read-only to script but not flagged as such. For example, this method did not return false:

func _is_prop_valid(property_data:Dictionary) -> bool:
	# cannot change read-only properties
	if property_data["usage"] & PROPERTY_USAGE_READ_ONLY:
		return false

	return true

Any other ways to catch when a property is read only via native implementation?

That doesn’t make it read-only.

I should have specified in the original post (updated just now): the custom node was authored in native, not gdscript, and was authored there as a field with a getter but no setter. This makes it effectively read-only, but not via the property flag (afaik). The error thrown when attempting to set from script confirms:

ERROR: res://import_test.gd:214 - Cannot set value into property “foo” (on base “EyesNode”) because it is read-only.

Then try setting the flag in native code.