Repository: godot
Issue: C#: Error disconnecting from signal event when not connected in the first place
Labels: bug,topic:dotnet

### Godot version

v4.0.rc.mono.custom_build [d02a7bc00]

### System information

Windows 10

### Issue description

When trying to `-=` on a signal event with a delegate that was never `+=` in the first place raises the following error.

```
E 0:00:01:0584   Godot.NativeInterop.NativeFuncs.generated.cs:332 @ void Godot.NativeInterop.NativeFuncs.godotsharp_method_bind_ptrcall(IntPtr , IntPtr , System.Void** , System.Void* ): Attempt to disconnect a nonexistent connection from '<Node2D#28319940999>'. Signal: 'tree_exited', callable: 'Delegate::Invoke'.
  <C++ Error>    Condition "signal_is_valid" is true.
  <C++ Source>   core\object\object.cpp:1327 @ Object::_disconnect()
  <Stack Trace>  Godot.NativeInterop.NativeFuncs.generated.cs:332 @ void Godot.NativeInterop.NativeFuncs.godotsharp_method_bind_ptrcall(IntPtr , IntPtr , System.Void** , System.Void* )
                 NativeCalls.cs:3541 @ void Godot.NativeCalls.godot_icall_2_412(IntPtr , IntPtr , Godot.NativeInterop.godot_string_name , Godot.Callable& )
                 GodotObject.cs:784 @ void Godot.GodotObject.Disconnect(Godot.StringName , Godot.Callable )
                 Node.cs:1627 @ void Godot.Node.remove_TreeExited(System.Action )
                 Test.cs:7 @ void Test._Ready()
                 Node.cs:1782 @ Boolean Godot.Node.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name& , Godot.NativeInterop.NativeVariantPtrArgs , Godot.NativeInterop.godot_variant& )
                 CanvasItem.cs:1369 @ Boolean Godot.CanvasItem.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name& , Godot.NativeInterop.NativeVariantPtrArgs , Godot.NativeInterop.godot_variant& )
                 Node2D.cs:515 @ Boolean Godot.Node2D.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name& , Godot.NativeInterop.NativeVariantPtrArgs , Godot.NativeInterop.godot_variant& )
                 Test_ScriptMethods.generated.cs:31 @ Boolean Test.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name& , Godot.NativeInterop.NativeVariantPtrArgs , Godot.NativeInterop.godot_variant& )
                 CSharpInstanceBridge.cs:24 @ Godot.NativeInterop.godot_bool Godot.Bridge.CSharpInstanceBridge.Call(IntPtr , Godot.NativeInterop.godot_string_name* , Godot.NativeInterop.godot_variant** , Int32 , Godot.NativeInterop.godot_variant_call_error* , Godot.NativeInterop.godot_variant* )
```

Essentially, the following script would error out.
```cs
using Godot;

public partial class Test : Node2D
{
    public override void _Ready()
    {
        // TreeExited += WhenTreeExited; // Uncomment to avoid the error.
        TreeExited -= WhenTreeExited;
    }

    private void WhenTreeExited() { }
}
```

Note that this only affects the events provided by the engine. Custom signals do not share this behaviour. The following script executes without any issue.

```cs
using Godot;

public partial class Test : Node2D
{
    [Signal]
    public delegate void MySignalEventHandler();

    public override void _Ready()
    {
        MySignal -= WhenMySignal;
    }

    private void WhenMySignal() { }
}
```

### Steps to reproduce

- Create a node in a scene.
- Attach the first script shared above to said node.
- Run the game.

### Minimal reproduction project

N/A