If I unlock an encrypted wallet for 359711509437336256 or less seconds, I can sign transactions with it:

    $ bitcoin-cli walletpassphrase "$x" 359711509437336256
    $ echo $?
    0
    $ bitcoin-cli signrawtransaction $tx | grep complete
      "complete": true

But if I unlock it for 359711509437336257 or more seconds, it appears to have unlocked but I can't sign any transactions:

    $ bitcoin-cli walletpassphrase "$x" 359711509437336257
    $ echo $?
    0
    $ bitcoin-cli signrawtransaction $tx | grep complete
    error code: -13
    error message:
    Error: Please enter the wallet passphrase with walletpassphrase first.

I don't know the significance of that number. It's nowhere near a power of 2.

I was trying to unlock the wallet effectively "forever", so put a big number. If I use too big a number (2^63 or more) I get an error message `JSON integer out of range` but for numbers between 359711509437336257 and 2^63-1 inclusive I get no error, but no actual unlocking.
std::string strSentAccount;
        std::list<COutputEntry> listReceived;
        std::list<COutputEntry> listSent;
        int nDepth = wtx.GetDepthInMainChain();
        if (wtx.GetBlocksToMaturity() > 0 || nDepth < 0)
            continue;
        wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, includeWatchonly);
        mapAccountBalances[strSentAccount] -= nFee;
        for (const COutputEntry& s : listSent)
            mapAccountBalances[strSentAccount] -= s.amount;
        if (nDepth >= nMinDepth)
        {
            for (const COutputEntry& r : listReceived)
                if (pwallet->mapAddressBook.count(r.destination)) {
                    mapAccountBalances[pwallet->mapAddressBook[r.destination].name] += r.amount;
                }
                else
                    mapAccountBalances[""] += r.amount;
        }
    }
    const std::list<CAccountingEntry>& acentries = pwallet->laccentries;
    for (const CAccountingEntry& entry : acentries)
        mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
    UniValue ret(UniValue::VOBJ);
    for (const std::pair<std::string, CAmount>& accountBalance : mapAccountBalances) {
        ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));
    }
    return ret;
}
UniValue listsinceblock(const JSONRPCRequest& request)