Implementations of TaskExecutor::scheduleWork are required not to move-from their provided 'work' CallbackFn when returning a non-ok status. This requirement is relied on in TaskExecutor::schedule to call the callback with the non-ok status returned from scheduleWork.
ScopedTaskExecutor is violating this contract and moving-from the provided work callback even when returning a non-ok Status from scheduleWork. We have evidence of this happening from build failures. While not confirmed, the likely culprit is this line. We need to fix this or else risk triggering this invariant in production runs.