Whether solar panels reduce the amount of suns rays reflected back into space depends on their albedo and the albedo of the surface that they cover. Desert sand, for example, is fairly reflective and solar panels might reflect less sunlight back into space than deserts, but it's not just the reflection that matters. You also have to account for energy production.
If enough solar panels are built that fossil fuel generated electricity (usually coal or natural gas), can be reduced, by 5% or 10%, that works out to a pretty useful drop in CO2 footprint. Less CO2 from burning fossil fuels means less warming. The ratio of surface temperature by absorbed sunlight vs reflected sunlight is on average, less significant than the heat trapping of CO2. Explaining that gets kind of long and mathy and it's full of approximations, but as a ballpark estimate, 1 joule of energy produced by fossil fuels and the CO2 that's released by that process, that CO2 warms the atmosphere by several joules. We can see this by estimating the added heat to the air and oceans as a result of climate change and comparing that to the energy use of all mankind. I might add a crude calculation of my own later, but here's an article that says the ratio of heat captured by man made climate change to waste heat has a ratio of 100 to 1.
However you calculated it, the added heat by increases in CO2 exceeds any albedo variation by at least an order of magnitude, possibly two. So even if Solar panels did absorb and retain more heat from sunlight than the surface area they cover, they still should lead to cooling by reducing the CO2 footprint. The more important question is whether energy from solar panels can effectively reduce CO2 output from power-plants, because power-plants need to cover demand and solar energy can be intermittent. Still, if there is any measurable reduction in fossil fuel generated electricity, there should be a net cooling due to how effective CO2 is in trapping heat even if the solar panels aren't efficient reflectors of sunlight.
The way I understand the basics of global warming is we are putting to
much Co2 into the atmosphere which increases the size / density of
This is incorrect. It's not the size or density of the atmosphere but it's opacity to the long-wavelength infrared light radiating from the Earth that drives climate change. (feedback mechanisms like melting ice and rising albedo play a role too), but changes in the Atmosphere's density or mass are largely irrelevant.
Burning fossil fuels doesn't change the density or mass of the Atmosphere much anyway and they might even make the atmosphere a little lighter, though the overall calculation gets pretty complex with plant growth and oceanic absorption.
When fossil fuels are burned, O2 is taken from the air, combined with hydrocarbons in the fuel which becomes CO2 and H20. The net mass change of O2 lost and CO2 gained depends on the Carbon to Hydrogen ratio of the fuel burned, but the effect is pretty small either way. High hydrogen fuels like Methane, the primary ingredient in natural gas, takes more O2 from the air by mass than it returns in CO2. More Carbon rich hydrocarbons like coal, the mass ratio is closer to even. But in either case, the 30 plus billion tons of CO2 that's produced every year is negligible compared to the 5.1 million billion tons of the atmosphere. That's less than 1 part in 100,000 by mass per year.
What drives climate change is what happens to the long-wavelength infra-red light that leaves the Earth. The longer wavelength photons that leave the Earth sometimes hit a molecule of CO2 that temporarily wiggles, before reflecting that light-energy back. That's the basis of the Greenhouse effect. The reflection back to the Earth of long wavelength infrared light. and more CO2 means more IR light gets reflected, which adds heat to the atmosphere.
In a nutshell it's the color of the sky, that is, color in wavelengths we can't see, so calling it color isn't quite right either, but that's the gist of the greenhouse effect. Opacity not Density, though if you were to make Earth's atmosphere a lot more massive, say 10%-20%, that could have an effect, but we don't have the means to do that.
sun rays enter the atmosphere then there is some reflection off the
earth and then the reflected rays get trapped within the atmosphere
This is generally true. Reflectivity is an important aspect of Earth's energy budget and Albedo of a solar panel is one aspect of solarpanel design. That said, Solar panels cover such a small percentage of the Earth's surface, that their effect on reflection is negligible. Also, reflected rays are less likely to get trapped in the atmosphere than infrared rays. The Atmosphere is largely transparent to visible light and reflected rays of light are mostly in the visible spectrum.
An interesting and related question to ask is, instead of installing solar panels, what if we paint things white (well, you might not want a white roof in winter, so that might not be a perfect solution) but in someplace where it's always warm/hot all year round and white roofs are common. White paint would reflect more sunlight back into space than a typical solarpanel would. The math gets tricky where you have to weigh the fossil fuel use reduced against the increase in light reflected. Here's an article that touches on that in some detail.
I also want to add that the dark color of solar panels is designed to absorb sunlight and turn it into electricity. A reflective solar-panel kind of defeats the purpose, unless you're talking concentrated solar power which works based on reflection, but those aren't typical solar panels, though they are solar energy.