New code in #10995 uses RPC_INVALID_REQUEST. According to the comment in rpc/protocol.h:
// RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400).
// It should not be used for application-layer errors.
Change the returned error code to RPC_WALLET_ERROR
#11000 will need to be updated to test for the correct error code.