The thing with iPhone trade-in values with Apple... is that the trade-in value doesn't change based on storage size. The Pro Max for example, will be the same trade-in value if you got the 256gb base model vs the 1TB. Obviously the 1TB was significantly more expensive when you bought it vs the 256gb base.
In general, trading in directly with Apple will give you less $ than the true secondary market value (on sites like Ebay, Swappa, etc.), but that gap increases the more storage you have. It might only be $100 less than FMV on the secondary market for the 256gb, but $300 less for the 1TB.
For base models, trading in directly with Apple is often worth it to save the headache of selling, potential for scams, etc. But the more upgraded version you have, the less it makes sense...