It's called stacking the deal.
They get commission on finance, so if you are funding £17k ( £21,995 less £5k for yours ) they are liable for a nice chunk of commission, probably over a grand on that balance depending on their base rate.
This gives them much more to play with than chassis profit alone so if you are financing through them they can offer you more for your car.
The way they are dealing with you tells me its probably Perrys ?
Bear in mind the 350z is a good seller so they won't want to give the car away, they have a minimum profit they aim for and they won't do a deal that makes much less than that figure, especially on a car they know they can sell.
They are also taking your car from you and it needs work, and they need to make a profit on your car too.
At the end of the day when you are trading a car in the price of their car and the price of your car is immaterial, you need to focus on the balance to change, the difference between the two values. Tell them how much you want to pay and let them do the rest. Their base rate will be very low and they can do you a cracking deal if they really want to !
Good luck mate.
I understand what your saying, and no offence to you, but its bollocks.
The zed has a value. His Celica has a value. How the balance is paid is immaterial and should not affect the previous two variables at all.