As of #11466 we no longer have any logic to prevent a user from opening a wallet twice in two instances simultaneously. Not only could this break BDB (without the -privdb=false option, which I have really no idea why we even have a tuneable option for that), but we certainly don't have logic to handle such a case gracefully. It was noted in the original PR's description, but somehow was never followed up on before merge.
{
private:
    bool fDbEnvInit;
    bool fMockDb;
    
    
    std::string strPath;
    void EnvShutdown();
public:
    mutable CCriticalSection cs_db;
    std::unique_ptr<DbEnv> dbenv;
    std::map<std::string, int> mapFileUseCount;
    std::map<std::string, Db*> mapDb;
    CDBEnv();
    ~CDBEnv();
    void Reset();
    void MakeMock();
    bool IsMock() const { return fMockDb; }
    /**
     * Verify that database file strFile is OK. If it is not,
     * call the callback to try to recover.
     * This must be called BEFORE strFile is opened.
     * Returns true if strFile is OK.
     */
    enum VerifyResult { VERIFY_OK,