**Expected behavior**
It is expected that Bitcoin Core is not shutdown automatically during startup. Moreover, it should be possible to set transaction fee at 0.

**Actual behavior**
![Bitcoin Core Error mintxfee](https://user-images.githubusercontent.com/111286121/210274894-e91adf7f-43f7-4c3f-b799-222c00dc34a0.png)

**To reproduce**

1) Click bitcoin-qt.exe.

**System information**

1) A wallet that contained unspent funds was opened previously.
2) The bitcoin.conf file contains "mintxfee=0".
3) Bitcoin Core 24.0.1 official binary for Windows (portable).
mapTxSpends.insert(stdmake_pair(outpoint, wtxid));
    if (batch) {
        UnlockCoin(outpoint, batch);
    } else {
        WalletBatch temp_batch(GetDatabase());
        UnlockCoin(outpoint, &temp_batch);
    }
    stdpair<TxSpendsiterator, TxSpendsiterator> range;
    range = mapTxSpends.equal_range(outpoint);
    SyncMetaData(range);
}
void CWalletAddToSpends(const CWalletTx& wtx, WalletBatch* batch)
{
    if (wtx.IsCoinBase()) // C
        return;
    for (const CTxIn& txin  wtx.tx->vin)
        AddToSpends(txin.prevout, wtx.GetHash(), batch);
}
bool CWalletEncryptWallet(const SecureString& strWalletPassphrase)
{
    if (IsCrypted())
        return false;
    CKeyingMaterial _vMasterKey;
    _vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);
    GetStrongRandBytes(_vMasterKey);
    CMasterKey kMasterKey;
    kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE);
    GetStrongRandBytes(kMasterKey.vchSalt);
    CCrypter crypter;
    int64_t nStartTime = GetTimeMillis();