This was apparently a known bug with Godot 4.3, fixed in Godot 4.4. Upgrading the code to Godot 4.4 fixed the issue.