The stuff from Fix setting parents in symbol tree when filtering is used #3050 should only be applied when filter changes
Or, to avoid making the code more complicated in the tree update function, just to remove everything from the tree when filter changes and get the whole tree re-populated. The main purpose of the complicated code in the symbol tree update function is to avoid scrolling when a change is made in editor but when applying filter, this will happen anyway because the changes in the tree are big.