While always and never should be avoided, the military supply system should have prevented it, unless there were no more A1 barrels in the supply system. By the time the A2 was introduced, supply is being computerized.
Your unit is assigned certain types of weapons, and each of the parts has a stock number. If your unit had A1s, and you ordered an A2 barrel, which has a different stock number, the supply system should kick that back as an unauthorized item. Exception would be if A1 parts ran out, and the A2 part was an acceptable substitute part (handguards, grips, stocks) as functional equivalents.
This is why weapons fielding goes brigade by brigade, the supply system needs to match what you can order to what you are supposed to have on hand, or is part of the PLL (Prescribed Load List) of spares to be kept on hand for operational needs.
Units don't order ammo by caliber, it goes by DODIC, so you order M193 ball, M855A1 ball, M856 tracer, M200 blank and so on.
That being said, mismatches do occur, especially as the Army is in transition as happened in sandbox I. The combat brigades deployed were all M16A2 rifle/ M9 pistol equipped, bu the reserve units deployed were frequently still M16A1 / M1911A1 equipped. An example is in 2nd Brigade, 1AD, our Civil Affairs support team came from an Army Reserve unit in Rochester, NY. So, while all of the active duty folks in the brigade area were M16A2 equipped, there were still M16A1 equipped units that came from the reserve component. Even at that, the reserve units did not draw weapons parts from the 47th Support Battalion of 1AD, unless there would have been a repair that their unit armorer was not authorized to make. Barrel replacement is a unit armorer task.