Thanks for looking into this!
Oh, sorry, my bad, it's not only those conditions.
On that 31st tick, mod also doesn't bother to run UV lamps' routines unless there are wisps on the map, which is likely not the case during daytime.
So I think you should see those leftover entitites gone once these lamps will be needed, or maybe do /c game.player.insert{name="wisp-yellow", count=50}
and spawn those anytime to force it.
Using Creative Mod, I disabled "Freeze daytime", set game speed to 20 and let the game run for some minutes (real time). That didn't help at all to get the invalid entries removed. (Alas, it was not a real game, I just cheated a power source and some UV lamps, so there was no real production and that may be the reason why no wisps were spawned.) After releasing one of the yellow wisps I got using your command, the records were gone.
Guess this kind of lazy GC can be a potential problem with mods that create and destroy a lot of transient entities, like on every couple ticks or something.
Actually, my mod just may just create some new prototypes (depending on settings). All I do in control.lua is calling emit_start when one of the build events is raised. I guess it really wouldn't make sense in my case to listen to removal events and call emit_stop as well.