Endogenous CO production is mainly due to the inducible heme oxygenase (HO-1) enzyme, which catalyzes the heme moiety of Hb to biliverdin and liberates CO during this process.