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.
"    {\n"
            "      \"account\" : \"accountname\",      (string) DEPRECATED. The account name involved in the transaction, can be \"\" for the default account.\n"
            "      \"address\" : \"address\",          (string) The bitcoin address involved in the transaction\n"
            "      \"category\" : \"send|receive\",    (string) The category, either 'send' or 'receive'\n"
            "      \"amount\" : x.xxx,                 (numeric) The amount in " + CURRENCY_UNIT + "\n"
            "      \"label\" : \"label\",              (string) A comment for the address/transaction, if any\n"
            "      \"vout\" : n,                       (numeric) the vout value\n"
            "      \"fee\": x.xxx,                     (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
            "                                           'send' category of transactions.\n"
            "      \"abandoned\": xxx                  (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n"
            "                                           'send' category of transactions.\n"
            "    }\n"
            "    ,...\n"
            "  ],\n"
            "  \"hex\" : \"data\"         (string) Raw data for transaction\n"
            "}\n"
            "\nExamples:\n"
            + HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
            + HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true")
            + HelpExampleRpc("gettransaction", "\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
        );
    ObserveSafeMode();
    
    
    pwallet->BlockUntilSyncedToCurrentChain();
    LOCK2(cs_main, pwallet->cs_wallet);
    uint256 hash;
    hash.SetHex(request.params[0].get_str());
    isminefilter filter = ISMINE_SPENDABLE;
    if(!request.params[1].isNull())