When a transaction is constructed through the RPC interface, it is submitted to the mempool for broadcast. The mempool has certain limits on how many descendants or ancestors a transaction can have, and in certain cases a transaction generated by bitcoind's wallet may fail these checks.
The current error surfaced by the RPC interface in this case is misleading.
From the original issue:
If coin selection fails as part of send or sendtoaddress, the error message returned to the RPC client is Insufficient funds, even if the actual cause is due to too-long-mempool-chain. This is likely to alarm users unnecessarily, as they will believe this means their funds have permanently vanished rather than being temporarily inaccessible.
If coin selection fails due to too-long-mempool-chain, the send and sendtoaddress methods should pass that error back to the RPC client, instead of Insufficient funds.
The related code is here.
Get a PR merged which closes the original issue. Include unit-test coverage.