Are logical operations broken in UE 5.6.1?

I’m adding basic scrollwheel hotbar selection mechanics to my game. The way I do it is by storing the current item in a variable, getting the scroll wheel axis (either 1 or -1), finding the index of the current item in the inventory, then incrementing the index by the returned scroll axis. However, I’m getting weird logical errors where 0 >= 0 returns false:

and 3 < 3 returns true:

Here’s the whole setup:

What’s weird is that if I flip the logic and use OR instead of AND, everything works:

Am I missing something?

Do you have default Selected Spell?
Find and empty Selected Spell probably will return 0?
and if you scroll +1, it will not be greater than or equal to length
it return false

Variable values ​​may not be displayed correctly (at first glance).

You need to set a breakpoint one step later so that the branch “calculates” all variable values.
The most reliable way is to use Print String for viewing.

Yes, I do have a default spell selected and it’s one of the inventory items. It’s never an invalid spell.

I do have the breakpoint set “one step later” (see the Branch node in the last two screenshots)