You don't need to expel any carbon
There is actually a set of non-magical chemicals and reactions that can do exactly what you want, the magical part would be regenerating the "waste" chemicals back to the reactive form, keeping the temperature stable (some reactions are exothermic), and facilitating the reaction like a catalyst.
For converting carbon dioxide to oxygen, you can use a lithium peroxide reaction, which produces lithium carbonate and oxygen. Exhaled air is about 5% carbon dioxide, with a similar drop in oxygen content. Since the reaction of lithium peroxide is 2:1, this can enable you to breathe underwater if you provide half the oxygen, remove the exhaled water vapor and toxins, and regulate the pressure with inert gas such as nitrogen or helium.
Generation of nitrogen gas can be done in a separate partition by mixing liquid ammonia with hydrazine (using a magical catalyst), not a lot is needed since it is only there to replenish small amounts of removed impurities to balance the pressure and volume of air. This produces pure nitrogen and hydrogen gas, the hydrogen is expelled externally into the water or stored to produce pure water from air later.
For gas exchange, you would need to convert about 20ml of carbon dioxide per breath to oxygen at standard air pressure, at 2kg per cubic meter, that is around 40mg of carbon dioxide, requiring full utilization of 32mg of lithium peroxide. If you store say, 80 grams in the mask (about the weight of a respirator cartridge), that gives you 2500 breaths or 2 hours at normal exertion. If you are swimming or running you would have substantially less, maybe only 30 minutes, this is assuming there is no magical autoregeneration happening while you are breathing. You also need enough material and surface area for complete reaction, but this should not be a problem at the given utilization rates.
In other environments, where the mask filters out particulates and toxins, you would be more interested in getting rid of carbon monoxide from smoke. This is done by adding oxygen to produce carbon dioxide, at levels that are not toxic or could be removed by reaction.
In low oxygen environments or underwater where you need it, sodium chlorate can decompose into salt and release pure oxygen gas in the process. Generally this is a very high temperature reaction, magic would be needed to keep this safe in a mask. 160g of chlorate produces enough oxygen for around 1 hour of normal breathing in a no air environment, or 2 hours when combined with CO2 conversion. Magic could then be used to regenerate the salt into chlorate with a fresh oxygen or water source later, or it could just be replaced with new chlorate if salt is impervious to magic in your world. You can make it with electricity and hot salt water.
Designing a mask
Because of the different functions of both filtration, waste removal, and oxygen generation, the mask would need to be layered and partitioned. The outer layer (filtration) and inner layer (conversion) would need to be separated if needed, and an air bladder in the middle for breathing.
Underwater, the outer layer is isolated from the outside which is now water. The exhalation valve is shut off, and the nitrogen gas generator takes its place. The CO2 conversion layer is simply powder in a filter media that exhaled air passes through, it would normally leave the exhalation valve, but now underwater it goes through the filter and into the expanding air bladder, converting the CO2 to O2 as it passes through twice.
The outer layer is then routed back to the inner layer before the bladder, to slowly remove toxins and water vapor from the breath. The oxygen generator would be the closest to the mouth and work on a feedback mechanism, if O2 is low it makes more. The O2 generator also needs to be hooked to the outer layer to convert carbon monoxide to dioxide.
Magical components should keep the mask similar in size and shape to a standard half-face cartridge respirator mask like a 3M 7500 series with a little more bulk where the cartridges would attach, and an air bladder that expands out the side or bottom like a frog croaking. Depending on how much magic you want, the air bladder, exhalation valve, and separator valves could be replaced with force shields, further reducing the size and weight of the mask. The reactant weight would be around 240g in powder and maybe 50 in liquid. Removing CO2 increases the weight, but making oxygen reduces the weight, so the weight of the mask will vary a little with use, but not much. Ammonia and hydrazine can be provided by small ampules with rubber plugs, that are easily replaced when expended.
Chemically, all reactions are done without violating the laws of thermodynamics or by using cold fusion or alchemy. They could even be regenerated without magic at all, by adding fresh reactants by hand, and the magic components only acting to catalyze and regulate the reactions. A magical regneration of lithium peroxide at the rate that would be used by heavy breathing in normal air (1g per hour), or higher, would be ideal. That way you do not need manual exchange of the powder, and it adds a plot point if you have used it up underwater and now need it to regenerate. That is 80 hours of no mask use for full regeneration if fully depleted, mask use would pause generation but it would still be able to remove carbon monoxide.
The outer toxin filter would be the same design as those used today, activated carbon combined with reactants and chemical treatments, and a particulate blocking media, something like cellulose or rayon. It could be magically enhanced to continually clean itself or last longer than a non-magical filter.
The mask itself, plus the reactants, magical components, and outer filter would weight maybe 1.5 to 2.5 pounds, depending on mask material. I am assuming you do not have plastics, so probably leather and refined metals like aluminum or titanium, maybe held together with spider silk.