Your mistake is applying conservation of energy to an open system. It only applies to closed systems. If the earth is cooling the sun, then we should be able to remove the earth from the solar system and the sun will get warmer. That is impossible.
How would you know ?
To demonstrate what I am staying here and finding mutual ground. CO2 infrared emission can warm the cold ground slightly during the night. Energy flowing from excited state to less excitated state. It however cannot increase the temperature of the ground during the day when the sun is warming the ground. Because energy cannot flow from less excitated to more excitated.