Here's an article with exceptions to the rule. https://fairmark.com/investment-taxation/capital-gain/stock-sales/trade-date-and-settlement-date/