If you had a laparoscopic-assisted bowel resection, both air and CO2 were potentially used. Air (78% nitrogen) placed via the rectum to inflate the bowel when checking for connection leaks and CO2 placed through trocars for abdominal cavity insufflation needed for surgical visualization.
Room air is often used to inflate the bowel because it is readily available as well as simply and effectively regulated manually for volume and pressure--no potential issues with a compressed source, electomechanical valves or sensors. So, catastrophic pressures rupturing a relatively thin and fragile bowel (a disaster) gets more difficult to produce.
CO2 is employed because it is much more soluble/diffusible across tissue membranes for eventual exhalation, comes from a compressed source and is employed at a greater pressure. As mentioned by Noah930, it also will not support tissue fire from cautery source.
Air mostly stays put from a tissue diffusion perspective. Air in, U-turn, air out. Significant volumes of air left trapped in the abdominal cavity takes a potentially uncomfortable while to be absorbed. Finally, because of the differences in solubility and diffusion, a vascular
air embolus delivered at abdominal insufflation pressures is more likely to be fatal or otherwise catastrophic.
https://teachmephysiology.com/respiratory-system/gas-exchange/gas-exchange/
If it wasn't a bowel resection, then there are other potential explanations for your experience that may or may not involve CO2 or room air.