This study investigates an imperfect multi-stage production inventory system for a single product comprising two components: a packaging container and internal items. Each component is produced at a flexible production rate in separate manufacturing units. During the production of packaging containers, defective items are also produced. The carbon emissions in the inventory cycle are proportional to the production rate, and this study introduces a carbon emission function that depends on the production rate. If the manufacturer operates at the maximum production rate, the overall inventory cycle time decreases, but the carbon emissions increase, leading to higher carbon taxes and total costs. Thus, a trade-off exists between the production rate and the total cost. To mitigate carbon emissions, manufacturers invest in green technology, and this study incorporates a modified carbon emission reduction function dependent on green technology investment. The research aims to optimize the cost of green technology and the production rates for both components to minimize carbon emissions and total costs in the production line. Additionally, the paper explores all possible scenarios that could arise based on the relationship between the production rate and the overall cost for various cases. Hence, the seventh scenario is identified as the most suitable option for the manufacturer. The findings indicate that maintaining optimal production rates for both components and investing in green technology significantly reduces carbon emissions and lowers total costs. Specifically, the investment in green technology for example I, the maximum possible reduction in carbon emissions can reach up to 351%. For example II, the maximum reduction in carbon emissions can be up to 339.40%. As a result, the manufacturer pays less carbon tax, which reduces the total cost by 365.82% for example I and 72.31% for example II. This substantial reduction in carbon emissions contributes to a decreased carbon footprint, thereby supporting global efforts to combat climate change and promoting environmental sustainability. This indicates better results compared to the existing literature, as this paper incorporates more realistic assumptions than those found in previous studies. The study provides managerial insights for manufacturers in the numerical section, offering a numerical example and sensitivity analysis on various parameters using MATLAB software.