how to update a set

I adapted the text at https://www.gams.com/latest/docs/userguides/userguide/_u_g__dynamic_sets.html#UG_DynamicSets_SetComplement to your sets

"The membership of B4 is set equal to all those in Bi but not in B0. The operation above is equivalent to the following longer way of representation,

B4(Bi)=yes; B4(B0)=no;"

Key part is “all those in Bi”. That definition says nothing about those elements you have removed from Bi, and since you have added them to B4 before, they will remain there.

Easy way out:

Postpone B4 assignment

If that is undesirable:

Reset B4:

B4(B)=NO;
B4(Bi)=not B0(Bi);