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
{
    EnsureWalletIsUnlocked(wallet);
    
    
    if (wallet.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
        throw JSONRPCError(RPC_WALLET_ERROR, "Error: Private keys are disabled for this wallet");
    }
    
    std::shuffle(recipients.begin(), recipients.end(), FastRandomContext());
    
    CAmount nFeeRequired = 0;
    int nChangePosRet = -1;