Could also be something in the fuel line. When the engine is running the fuel pressure forces the debris into a fuel passage. When the engine stalls pressure is relaxed and the debris settles down, allowing fuel to pass and the engine to start back up.