Expected behavior:
listtransactions "*" 100 in a wallet with 35 transactions should list all 35 transactions in the wallet.
(Update: and given the way listtransactions works there will likely be more than one array entry for each transaction, right?)
Actual behavior:
listtransactions "*" 100 lists 14 transactions, but does not list 21 transactions that are self-sends.
Note that getwalletinfo returns:
"txcount": 35,
So the wallet does seem to know about the self-send transactions. (The "missing" transactions also show up in the GUI)
To reproduce
I have only seen the problem with one particular wallet. The only other wallet I have tested with is running on an older Bitcoin Core v0.20.1 (actually Omni Core) version and does seem to correctly list self-sends.
The wallet showing the problem is an imported HD tpub descriptor wallet that was created with bitcoinj and then the descriptors were imported via importdescriptors. I noticed that there is a Python functional test for listtransactions that checks self-sends, so perhaps the problem is related to it being a watch-only descriptor wallet with imported descriptors. It may also be relevant that the self-sends had two-outputs, both a "destination" and a change address.
I can reliably reproduce the problem with the wallet that is showing the problem.
System information
MacBook Pro M1 macOS Monterey 12.5.1
Bitcoin Core v23.0.0 pre-built "official" binary.
I am willing to provide additional information and/or run additional tests to help track this down.