Error with MultiMesh with transform_format MultiMesh.TRANSFORM_2D

Godot Version

4.2.2

Question

When running the following code I get the error:

E 0:00:00:0406 main.gd:20 @ _ready(): Condition “multimesh->xform_format != RenderingServer::MULTIMESH_TRANSFORM_3D” is true.
<C++ Source> servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp:1706 @ multimesh_instance_set_transform()
main.gd:20 @ _ready()

The scene has only a Node2D node with the script attached.
Am I doing something wrong or is this a bug?

extends Node2D



func _ready():
	var polygon = Polygon2D.new()
	polygon.polygon = PackedVector2Array([Vector2(0, 0), Vector2(50, 0), Vector2(25, 50)])
	polygon.visible = false  # Hide the original, used as a template
	add_child(polygon)

	var multimesh = MultiMesh.new()
	multimesh.transform_format = MultiMesh.TRANSFORM_2D
	# TODO color... or UV's... Or shader editor attachment?
	multimesh.instance_count = 2
	

	var instance1_transform = Transform2D(0, Vector2(0, 0))
	var instance2_transform = Transform2D(0, Vector2(100, 100))

	multimesh.set_instance_transform(0, instance1_transform)
	multimesh.set_instance_transform(1, instance2_transform)

	var multimesh_instance = MultiMeshInstance2D.new()
	multimesh_instance.multimesh = multimesh
	add_child(multimesh_instance)