How to remove non-functional devices when scanning for new

Those are actually being cached by the add-on, not the gateway. See here for instructions on fixing it: Problem deleting ZigBee things - cached in adapter?