Hello baby_possum,
Welcome to Apple Support Communities! The link MrBill3 posted is helpful, but the answer is a bit buried on the page. Here's the section that applies to your question:
"If you accept the trade-in estimate online when you purchase a new Mac, iPhone, iPad, or Apple Watch, we’ll arrange for you to send us your old device. Once we receive it, we’ll inspect it and verify its condition. If everything checks out, we’ll credit your original purchase method and send you any remaining balance on an Apple Store Gift Card via email."
So that's why the price goes up: the phone you are trading in must be sent in, evaluated, and then credit is returned to the card used to purchase.