I agree with you. This assertion isn't checking that case. It's checking `IsCompactionScheduled()` which is true when `bg_compaction_scheduled_` OR `imm != NULL`. If we somehow end up in this function when `bg_compaction_scheduled = true` but `imm != NULL`, the assertion should fire. Obviously, this doesn't affect things in production, but seems helpful to have proper assertion to help with future debugging in later code changes.