By your understanding of the second law of thermodynamics, not only greenhouse gases but greenhouses wouldn't be possible.
A new generation of satellites and ocean bases sensors has confirmed that more energy is entering the earth's atmosphere than is leaving it.
Joint NASA, NOAA Study Finds Earth's Energy Imbalance Has Doubled
"NASA's Clouds and the Earth's Radiant Energy System (CERES) suite of satellite sensors measure how much energy enters and leaves Earth's system. In addition, data from a global array of ocean floats, called Argo, enable an accurate estimate of the rate at which the world’s oceans are heating up. Since approximately 90 percent of the excess energy from an energy imbalance ends up in the ocean, the overall trends of incoming and outgoing radiation should broadly agree with changes in ocean heat content.
https://www.nasa.gov/feature/langley/joint-nasa-noaa-study-finds-earths-energy-imbalance-has-doubled
That imbalance is due to the fact that greenhouse gases are slowing the exit of infrared radiation from the planet.
Just because some a local phenomenon hasn't yet been figured out, doesn't mean that the large madel isn't working astonishingly well.