Inter-account transfers have no category and a non-null transfer_id. The spending-by-category command was only filtering out positive amounts (income) but not transfers, causing the negative side of each transfer to appear as "Uncategorized" spending.