Overriding a binding in Unity InputSystem button makes it trigger when held down

I have a simple button included in my InputActionAsset and I have set a new binding to it using the following code:

InputAction.ApplyBindingOverride(BindingIndex, newBinding);

My issue arises that the basic button should only trigger once when clicked and won’t fire again until you lift it and press it again. This functionality works fine before the binding, but after I bind the action it fires constantly while the new “key” is held down.

Why is this happening?

For anyone wondering.
I was initially calling this rebinding from the input action itself and maybe that was why it was causing the odd behaviour.
The problem for the change in “behaviour” for the button seems to go away if i call the rebinding from a separate place ie. a UI button for rebinding.
However; it still doesn’t really answer why there were multiple calls even if I were to call it multiple times.

The code with Error:

//This is the function called by the inputaction itself
public void Opt1EventProducer(InputAction.CallbackContext ctx) {
	if (ctx.performed) {
		SetNewBinding(KeybindingsManager.KeyBindingOptions.Opt1, "newBinding");
//the function responsible for the binding override. It seems to work fine if not called from a inputaction itself for some reason.
        bool SetNewBinding(KeyBindingOptions action, string newBinding, int movementBindingIndex = 0) {
	InputAction IAction = GetInputActionFromEnum(action);
	IAction.ApplyBindingOverride(movementBindingIndex, newBinding);