This is the error I get:

```
$ bitcoin-cli -rpcwallet=descriptor -testnet upgradewallet                         <
error code: -1
error message:
wallet/rpcwallet.cpp:4522 (operator())
Internal bug detected: '!error.empty()'
You may report this issue here: https://github.com/bitcoin/bitcoin/issues
```

The daemon logs this:

```
2021-07-15T16:16:54Z [descriptor] Performing wallet upgrade to 169900
```

**Expected behavior**

When I do the same on the default (non-descriptor) wallet:

```
$ bitcoin-cli -rpcwallet="" -testnet upgradewallet                             
{
  "wallet_name": "",
  "previous_version": 169900,
  "current_version": 169900,
  "result": "Already at latest version. Wallet version unchanged."
}
```

<!-- **Actual behavior** -->

<!-- See above. Isn't this kind of backwards, to first ask what I expect and then ask what I got? I am writing here because I got something strange in the first place... -->

**System information**

Bitcoin Core v0.21.1 Linux x86_64 glibc (Ubuntu) using binarias from bitcoincore.org

#ifndef BITCOIN_WALLET_SCRIPTPUBKEYMAN_H
#define BITCOIN_WALLET_SCRIPTPUBKEYMAN_H
#include <psbt.h>
#include <script/descriptor.h>
#include <script/signingprovider.h>
#include <script/standard.h>
#include <util/error.h>
#include <util/message.h>
#include <util/time.h>
#include <wallet/crypter.h>
#include <wallet/ismine.h>
#include <wallet/walletdb.h>
#include <wallet/walletutil.h>
#include <boost/signals2/signal.hpp>
#include <unordered_map>
enum class OutputType;
struct bilingual_str;
class WalletStorage
{
public:
    virtual ~WalletStorage() = default;
    virtual const std::string GetDisplayName() const = 0;
    virtual WalletDatabase& GetDatabase() const = 0;
    virtual bool IsWalletFlagSet(uint64_t) const = 0;
    virtual void UnsetBlankWalletFlag(WalletBatch&) = 0;
    virtual bool CanSupportFeature(enum WalletFeature) const = 0;