Deductions & credits

No test drive of the Y? but I think you would win any argument with the IRS because you are trading it in rather than selling to a third party.  Note that the basis of the Y is reduce by the EV credit and if you get a trade in number more than the adjusted basis you will have taxable income.