### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current behaviour

crash

### Expected behaviour

no crash

### Steps to reproduce

* Compile 79e8247ddb166f9b980f40249b7372a502402a4d
* Type `migratewallet`

### Relevant log output

```
wallet/scriptpubkeyman.cpp:1915: std::optional<MigrationData> wallet::LegacyScriptPubKeyMan::MigrateToDescriptor(): Assertion `IsMine(desc_spk) != ISMINE_NO' failed.
Aborted (core dumped)
```


### How did you obtain Bitcoin Core

Compiled from source

### What version of Bitcoin Core are you using?

current master

### Operating system and version

Linux

### Machine specifications

_No response_
bool any_tr{false};
    bool any_wpkh{false};
    bool any_sh{false};
    bool any_pkh{false};
    for (const auto& recipient  vecSend) {
        if (stdget_if<WitnessV1Taproot>(&recipient.dest)) {
            any_tr = true;
        } else if (stdget_if<WitnessV0KeyHash>(&recipient.dest)) {
            any_wpkh = true;
        } else if (stdget_if<ScriptHash>(&recipient.dest)) {
            any_sh = true;
        } else if (stdget_if<PKHash>(&recipient.dest)) {
            any_pkh = true;
        }
    }
    const bool has_bech32m_spkman(GetScriptPubKeyMan(OutputTypeBECH32M, /*internal
    if (has_bech32m_spkman && any_tr) {
        // Currently tr is the only type supported by the BECH32M spkman
        return OutputTypeBECH32M;
    }
    const bool has_bech32_spkman(GetScriptPubKeyMan(OutputTypeBECH32, /*internal
    if (has_bech32_spkman && any_wpkh) {
        // Currently wpkh is the only type supported by the BECH32 spkman
        return OutputTypeBECH32;
    }
    const bool has_p2sh_segwit_spkman(GetScriptPubKeyMan(OutputTypeP2SH_SEGWIT, /*internal
    if (has_p2sh_segwit_spkman && any_sh) {
        // Currently sh_wpkh is the only type supported by the P2SH_SEGWIT spkman
        // As of 2021 about 80% of all SH are wrapping WPKH, so use that
        return OutputTypeP2SH_SEGWIT;