When I upgraded from iPhone 8 to 12, I had to go through AT&T because I also needed to upgrade my line. It worked out fine but the trade in process was a little tricky, at least at the time (I needed to pay close attention to the fine print and apply a trade in offer code to the order).You can order on Apple, and trade the phone in with AT&T presumably. I've always just done it direct through AT&T.
When I upgraded from iPhone 12 to 14 Pro, I went through Apple and it was as smooth as silk. I ordered the phone through the Apple Store app, and picked it up at my local Apple store an hour or so later. Apple handled everything involved with setting up the new phone and setting up the AT&T financing (it was actually an Apple finance plan assigned to AT&T under the terms advertised by AT&T, and applied to my AT&T account).
A few days later I received a shipping box from Apple to mail in the old phone, along with tracking (FedEx) in both directions. The trade was processed by Apple (actually by an Apple vendor) and automatically went through to AT&T with no issues for the full trade-in value.
Based on my experience, trading in through Apple was a better experience than through AT&T, especially if you prefer to pick up the new phone at an Apple store rather than having it shipped to you. The Apple Store app (and Apple website) was easy to use and worked perfectly from ordering to pick-up to trade-in, including automatically recognizing that I was trading in the phone and account from which I was using the Apple Store app. I think AT&T has improved their trade-in website but it still isn't as slick end-to-end as Apple's.