Result of wherecontain() changed in if()

Weird thing happened, I have a if() function

if(
    my condition,
    value when true,
    remove(local!myList, wherecontains(cons!code, local!myList.code))
)

when I take the remove() out of if(), it's result is a list of 4 items, but in if(), it's result is a list of 1 item

And I tried with wherecontains(), when it's a standalone out of if(), the result is List of Number (Integer) - 0 items, but in if() the result became 

But why would this remove 3 items from myList?

  Discussion posts and replies are publicly visible