issue
When using the formula LAG/LEAD(Value to offset, Offset amount, Substitute value) in the classic engine, if 'Value to offset' and 'Substitute value' are not numeric, you will receive the following error if the 'Offset amount' is a line item reference
The 'value' argument for the 'LEAD' function should have datatype of NUMBER not BOOLEAN:
LEAD(value:NUMBER, offset:NUMBER, fill:NUMBER, [mode:?])
workaround
Use a direct numeric value as the second argument in the formula rather than a number-formatted line item
OR
Use the OFFSET function instead. OFFSET works the same as non-strict LEAD, and you should make sure the second argument is a negative value if you want to simulate the LAG function.