Custom composite binding with modifiers: Cannot find public field 'Modifier 1'

using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Layouts;

// boilerplate

public class Vector2DigitalNormalizedWithMods : InputBindingComposite<Vector2>
    [InputControl(layout = "Button")]
    public int up;
    [InputControl(layout = "Button")]
    public int down;
    [InputControl(layout = "Button")]
    public int left;
    [InputControl(layout = "Button")]
    public int right;
    [InputControl(layout = "Button")]
    public int modifier1;
    [InputControl(layout = "Button")]
    public int modifier2;

    public float modifier1Scalar;
    public float modifier2Scalar;

    public override Vector2 ReadValue(ref InputBindingCompositeContext context)
        var upIsPressed = context.ReadValueAsButton(up);
        var downIsPressed = context.ReadValueAsButton(down);
        var leftIsPressed = context.ReadValueAsButton(left);
        var rightIsPressed = context.ReadValueAsButton(right);

        Vector2 result = DpadControl.MakeDpadVector(upIsPressed, downIsPressed, leftIsPressed, rightIsPressed, true);

        // only valid if ONLY 1 is down
        if (context.ReadValueAsButton(modifier1) && !context.ReadValueAsButton(modifier2))
            return result * modifier1Scalar;

        // no matter what if 2 is down, thats the result
        if (context.ReadValueAsButton(modifier2))
            return result * modifier2Scalar;

        return result;

    // boilerplate
    static Vector2DigitalNormalizedWithMods()

    // boilerplate
    static void Init()


Both modifiers cause the errors "InvalidOperationException while resolving binding...", "InvalidOperationException: Cannot find public field 'Modifier 1' / 'Modifier 2'..."

I found this thread here, but that solution does not make a difference in my case.

Is there something wrong with my implementation? Any ideas or help is appreciated thanks.