Apologies. Reading over this again, I can only conclude that I must have skimmed the post and written the code the way I wanted it to behave. Personally speaking, I would expect it to completely overwrite all existing groups, so it would act like when you copy from Assembling machine -> Requester chest.
Adjusting the code to follow the OP more accurately looks something like this:
local control = dest.get_or_create_control_behavior()
for n = control.sections_count, 1, -1 do
local sect = control.get_section(n)
if sect.group == "" and sect.filters_count == 0 then
control.remove_section(n)
end
end