I'm not so sure your experiment would work unless you specify various other conditions. The main reason that CO2 is a 'greenhouse gas' is that it absorbs thermal infrared light. In other words, CO2 'reflects' infrared light. This, combined with the fact that the sun is continuously heating the earth means that -- in the context of the Earth's atmosphere -- CO2 acts like a giant blanket. Only in the context of a continuously externally heated object does CO2 cause temperature increases, which is not something that is necessarily going to be simulated by 'putting CO2 into a bottle'.
However, CO2 by itself does not cause things to heat up. That is patently ridiculous, and bad science. In fact, if you fill a jar with CO2 and water gas (also a greenhouse gas), and expose it to the air on a cloudless night, and then put some kind of insulating layer between it and the earth (like some feet of straw), it'll actually freeze: https://pazhayathu.blogspot.com/2012/02/water-cooler-air-con...
This is a video demonstration. All you need is 2 bottles under the same amount of illumination with different amounts of co2.
Sorry, I should have said, under illumination, and the temperature will reach a higher equilibrium with co2 in it, but it will not rise without limit.
I wonder if something like that has been done.
To be honest that uncertainty about exactly how things will turn out is what makes me most concerned about global warming. Better to play Russian roulette with 6 blanks that'll ruin the hearing in one ear than with 4 blanks, one entirely empty chamber, and one actual bullet. IPCC forecasts are bad but they're not unbearably bad. The real danger is that thing'll go far worse even if we can also plausibly hope that they'll be far better.
There's a lot of energy going by, and greenhouse gasses grab a slice of it that is otherwise poorly grabbed.
Perhaps picture a small cabin, with a big hot stove, and a window open to bitter arctic night. Without the window, you soon bake. Without the stove, you soon freeze. You tweak the window's openness to change room temperature. Keeping or killing your house plants as you prefer. The window is a patchwork, some patches overlapping, some not. The part of the window along the ceiling matters a lot, as much heat is trying to escape there. Tweak a patch over an otherwise open hole there, and it matters.
Earth is doing a BBQ roll, hanging between white hot Sun, and black cryo space. The atmosphere fluffs out during the day, and contracts at night. Lunar day is 120-ish C. If aliens umbrellaed the Earth, then vacuum would come down to ground, the atmosphere become some meters of oxygen nitrogen snow. That's a large flow of energy going by. Atmospheric water absorbs, and emits back, a lot of heat - deserts get cold at night. Different molecules have different absorption spectra. CO2 absorbs well at some frequencies water doesn't. Including in thermal infrared, where ground is radiating heat to space.
As an aside, Stanford has a fun project for more efficient refrigeration. A material engineered to preferentially emit heat, thermal infrared, at frequencies less well absorbed by the atmosphere. The "holes". So just sitting on a roof, it's cooler than the roof, because it can better "see" space than the roof can.
The modification is invisible to you, but not invisible to the photons which are supposed to leave the atmosphere and cool off the earth a bit. It it were visible to you, it would look like this:
https://www.youtube.com/watch?v=81FHVrXgzuA
Regarding the photons of thermal frequencies leaving the Earth atmosphere, or remaining there, the simplest you can imagine is a blanket: if it's cold outside the blanket keeps the heat not leaving the area under the blanket, keeping you warm. Here, the CO2 is actually a "one-way" blanket, it doesn't block the incoming radiation:
The heat coming from Sun has other frequencies as it comes than the photons blocked that would cool off the Earth.
The key is: CO2 is an ink-black "blanket" for exactly a part of the radiation that cools off the Earth. It's not too big, but big enough to make in sum that 0.8 C degree change since 1880. Or to produce even more warming in the coming years as we burn always more and we haven't managed to change that.
A little more precise:
"Energy arrives from the sun in the form of visible light and ultraviolet radiation. The Earth then emits some of this energy as infrared radiation. Greenhouse gases in the atmosphere 'capture' some of this heat, then re-emit it in all directions - including back to the Earth's surface."
(There's of course infrared radiation coming from the Sun, but the one making problem is the radiation from the Earth)
Scientific details, like absorption spectra and the measurements, are here: https://skepticalscience.com/print.php?r=35
A little simpler explanation by American Chemical Society:
https://www.acs.org/content/acs/en/climatescience/climatesci...
Or even, for kids, "meet Mr. Sunbeam" part from Futurama:
Temperature is increasing not because of increased insolation, but because of increased retention.