Trying to call callable, debugger says function doesn't exist.

Godot Version

4.2.2

Question

Hey all. Have recently been messing around with Godot and decided to try and create an “Action Queue” using Callables.

However I’ve been a bit stumped with an error I’ve gotten when I try to call “AddTest()” from the struct list.
I’m not very familiar with C# but I think it’s something to do with scope.

Code:

public struct ActionNode{
	public Callable Action {set;get;}
	
	public ActionNode(Callable action){
		this.Action = action;
	}
	
	public void AddParameter(Variant parameter){
		Callable temp = this.Action;
		this.Action = Callable.From(() => temp.Call(parameter));
	}
};

public partial class QueueHandler : Node
{
	private List<ActionNode> actionQueue = new List<ActionNode>();
	private int testNumber = 0;
	
	public override void _Ready(){
		actionQueue.Add(new ActionNode(false, "Add 1", new Callable(this, "AddTest")));
		actionQueue[0].AddParameter(1);
	}
	
	public void StepQueue(){
		actionQueue[0].Action.Call();
		actionQueue.RemoveAt(0);
	}
	
	private void AddTest(int toAdd){ testNumber += toAdd; }
}

The function works fine when called in _Ready(), but throws the debug error listed below when called from StepQueue(), which is connected to a Button signal.

GD.cs:366 @ void Godot.GD.PushError(string): Invalid call. Nonexistent callable 'Node(QueueHandler.cs)::AddTest'.

unless there is a reason for doing so, i would just use c# queues instead

using Godot;
using System.Collections.Generic;
[GlobalClass]
public partial class MyCsharp:Node {

	// a queue

	Queue<System.Action<int>> m_queue = new Queue<System.Action<int>>();


	// functions
	void MagicNumber1(int a_number) => GD.Print("called from MagicNumber1:", a_number);
	void MagicNumber2(int a_number) => GD.Print("called from MagicNumber2:", a_number);

	public MyCsharp() {


		// populate queue

		m_queue.Enqueue(MagicNumber1);
		m_queue.Enqueue(MagicNumber1);
		m_queue.Enqueue(MagicNumber2);
		m_queue.Enqueue((int a_number) => GD.Print("called from inline function:", a_number));
		m_queue.Enqueue(MagicNumber1);
		m_queue.Enqueue(MagicNumber2);
		m_queue.Enqueue(MagicNumber2);
		m_queue.Enqueue((int a_number) => GD.Print("called from inline function:", a_number));

		while(m_queue.Count > 0) {


			// remove from queue
			System.Action<int> v_action = m_queue.Dequeue();

			// invoke and pass int
			v_action(m_queue.Count);
		}
	}
}