Godot throws an error that a custom signal does not exist

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By auxterlibre

I have an EventManager class (AutoLoad) where I connect most of my signals. It is something like this:

signal my_signal

const MY_SIGNAL:String = "my_signal"

func add_listener(listener:Object, evt:String, method:String, params:Array = []):
	Utils.connect_event(self, evt, listener, method, params)


func remove_listener(listener:Object, evt:String, method:String):
	if listener.is_connected(evt, self, method):
		listener.disconnect(evt, self, method)

func send_event(evt:String, param1 = null, param2 = null):
	if param1 == null:
		emit_signal(evt)
	elif param2 == null:
		emit_signal(evt, param1)
	else:
		emit_signal(evt, param1, param2)

(I use the constant string so it is easier to fill the method parameters from outside the class.)

But when I am disconnecting one of my signals I get the following error:

E 0:00:02.365   is_connected: Nonexistent signal: overlay_completed.
  <C++ Error>   Method failed. Returning: false
  <C++ Source>  core/object.cpp:1548 @ is_connected()
  <Stack Trace> Events.gd:34 @ remove_listener()
                GameScreen.gd:38 @ on_overlay_completed()
                Events.gd:40 @ send_event()
                Overlay.gd:30 @ on_tween_completed()

But the overlay_completed signal exists and works. So why is this error showing up?