A user reported to me that they are unable to create a PSBT with a legacy watchonly wallet when they use the GUI. They get an error "The amount exceeds your balance".

I think the issue is that the GUI will retrieve the wallet's balance via `AvailableCoins` before calling `CreateTransaction`. This call to `AvailableCoins` is resulting in fewer coins being returned with recent changes to how `AvailableCoins` works, particularly with additional filtering of spendable coins and preset coins.

***

Note that this does not effect descriptor wallets. A workaround for this issue is to switch to using descriptor wallets. An existing legacy wallet can be turned into a descriptor wallet using the `migratewallet` RPC. However many watchonly legacy wallets are likely the result of importing descriptors via `importmulti`. For such wallets, I recommend creating a new descriptor wallet and re-importing the descriptors.
std::vector<CScript> dest_wallet;
    dest_wallet.reserve(output_type.size());
    for (auto type : output_type) {
        dest_wallet.emplace_back(GetScriptForDestination(getNewDestination(wallet, type)));
    }
    
    const auto& params = Params();
    unsigned int chain_size = 1000;
    for (unsigned int i = 0; i < chain_size / dest_wallet.size(); ++i) {
        for (const auto& dest : dest_wallet) {
            generateFakeBlock(params, test_setup->m_node, wallet, dest);
        }
    }
    
    auto bal = wallet::GetAvailableBalance(wallet); 
    assert(bal == 50 * COIN * (chain_size - COINBASE_MATURITY));
    bench.epochIterations(2).run([&] {
        LOCK(wallet.cs_wallet);
        const auto& res = wallet::AvailableCoins(wallet);
        assert(res.All().size() == (chain_size - COINBASE_MATURITY) * 2);
    });
}
static void WalletCreateTxUseOnlyPresetInputs(benchmark::Bench& bench) { WalletCreateTx(bench, OutputType::BECH32, false,
                                                                                        {{4}}); }
static void WalletCreateTxUsePresetInputsAndCoinSelection(benchmark::Bench& bench) { WalletCreateTx(bench, OutputType::BECH32, true,
                                                                                                    {{4}}); }
static void WalletAvailableCoins(benchmark::Bench& bench) { AvailableCoins(bench, {OutputType::BECH32M}); }
BENCHMARK(WalletCreateTxUseOnlyPresetInputs, benchmark::PriorityLevel::LOW)
BENCHMARK(WalletCreateTxUsePresetInputsAndCoinSelection, benchmark::PriorityLevel::LOW)
BENCHMARK(WalletAvailableCoins, benchmark::PriorityLevel::LOW);