It`s not a bug, it`s a feature:

first i argge with you small code
but you script is buggy
the are two ways to make the code

way 1:
if (%x < 10) goto next

wav 2:
if %x < 10 { goto next }


1:
//var %a = 1,%b = 2 | if (%a < %b) %b = 3 | echo -a %b
2:
//var %a = 1,%b = 2 | if %a < %b { %b = 3 } | echo -a %b

also this is not a bug you jus used the if-then-else wrong

The ( ) brackets enclose comparisons, whereas the { } brackets enclose the commands you want to be performed if a comparison is true. You must make sure that the number of ( ) and { } brackets match to make sure that the correct comparisons are made, and that the correct commands are executed.