Great question — answering as the UphillTech team:
Two different things can cancel that order, and the order note tells you which one it was. Woo's own cleanup always leaves the note "Unpaid order cancelled - time limit reached." — if that note isn't on the order, WooCommerce never touched it and the cancellation came from the gateway plugin. wc_cancel_unpaid_orders() only picks up orders that are still wc-pending and older than Hold stock (minutes) , and at the end of the run it re-schedules itself held_duration minutes ahead, so it can only ever fire late, never early. It also skips anything not created through checkout, via the filter it wraps the status change in: if ( apply_filters( 'woocommerce_cancel_unpaid_order', 'checkout' ===...
Full answer by CatCode: https://stackoverflow.stackexchange.com/a/80000247 (CC BY-SA 4.0).
Want it for your business? UphillTech.