Script:
class_name DuplicatingTemplateTest
extends VBoxContainer
#-- private variables:
var _template : Control
#-- _ready:
func _ready() -> void:
_template = $template
remove_child(_template)
#-- signal handlers: func _on_()
func _on_duplicator_pressed() -> void:
var instance := _template.duplicate()
add_child(instance)
func _on_template_pressed() -> void:
print("PRESSED")
if template has no signal or is not removed in _ready(), then the error doesn't appear.