It's not a terrible method and it's much better than just going in to your one local dealer and taking what they give for sure. Shopping multiple dealers, great step that a lot of people don't bother putting the effort into (can be a bore to do for sure). Let's do a quick review!
------
Using a $38,000 MSRP (Prem Plus starts at $36,620 w/ destination)
6% Target Discount (represents a good deal for consumers)
$35,720 Sale Price
+$85 Doc fee (capped in CA)
+~$600 Title and reg
---
$36,405 Sub total
-$20,000 Trade Value (a conservative fair trade value for your vehicle based on good condition and dealer auction values)
-$750 Loyalty Rebate
----
$15,655 Net
+$1,351 Est. Tax
---
$17,006 Out the Door
------
Looks like you ended up with a fair deal! I think the methodology has some blind spots, but it happened to work out perfectly well and I think you got a good deal here.
I'm not sure if your CX-5 trade was AWD or FWD, not sure on condition either which plays a big role of course, given you had Premium Package I think it would have been possible to get as much as $22k-$23k for your trade, and 7%-8% discount is not impossible either on the new car, but you're getting into the best case scenario territory. In my opinion, I would be happy with your deal