Consider a weightless vertical rod hinged at its center. Two identical inflated balloons are tied at each end of the rod. Entire system is under influence of gravity and is in air, so there are buoyancy forces on the balloon.(The system is in equilibrium, but is unstable because slightest push will cause the rod to rotate and become horizontal.) Now I heat the bottom balloon by supplying thermal energy equal to Q, and cool the top balloon at the same time by removing thermal energy equal to Q. So bottom balloon expands and the top one contracts. Overall net transfer of energy to this system (rod+balloon) is zero, but the potential energy of the system has increased, because density of air inside the balloon at the top is now greater than that at the bottom, compared to what it was before.
I know energy conservation cannot be violated, so where is the flaw in the argument?
Edit: Say initially, the density of air inside the balloons is the same as that of ambient air, so initially there are no buoyancy forces on the balloon.