If the reality is as you have mentioned, then this sale will be invalid because it is a way (Part No. 13; Page No. 197) of
making two transactions in one bargain. It was authentically reported that the Prophet (peace be upon him) forbade making two transactions in one bargain. This is because doing so may contain ignorance about the status of sale that leads to dispute and differences.
May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.