This would allow wallet operations like funding transactions with smart contract-based inputs such as LN, or any input the Core wallet doesn't know how to sign for.

https://github.com/bitcoin/bitcoin/pull/17211#issuecomment-933674310
fFirst = false;
                    txout.nValue -= to_reduce % outputs_to_subtract_fee_from;
                }
                
                if (IsDust(txout, wallet.chain().relayDustFee())) {
                    if (txout.nValue < 0) {
                        error = _("The transaction amount is too small to pay the fee");
                    } else {
                        error = _("The transaction amount is too small to send after the fee has been deducted");
                    }
                    return false;
                }
            }
            ++i;
        }
        nFeeRet = fee_needed;
    }
    
    if (scriptChange.empty() && nChangePosInOut != -1) {
        return false;
    }
    if (sign && !wallet.SignTransaction(txNew)) {
        error = _("Signing transaction failed");
        return false;
    }
    
    tx = MakeTransactionRef(std::move(txNew));
    
    if ((sign && GetTransactionWeight(*tx) > MAX_STANDARD_TX_WEIGHT) ||
        (!sign && tx_sizes.weight > MAX_STANDARD_TX_WEIGHT))