Modifying one array causes the other array to be modified

This has to do with how Pure nodes behave vs. non-pure.

Here are a couple posts describing basically the same issue you are experiencing :

On C++ side you normally make pure functions with the BlueprintPure specifier. I’m not aware of the engine doing that automatically for const methods, but maybe that is the case. Did your Filter node become different after removing const (added exec pins) ?