I think your problem may be that once they have power, they’re on and that’s it?
Even if you move them away, they still have power.
What about only making the original cubes powered, and the others take power from there, but never become powered themselves. Then, when you move them away, they will power off.
BTW, doing this on tick is not a good idea. You only need to update each cube’s status when one of them is moved, not every frame!