This study addresses the challenges of biodiesel production costs and waste oil disposal by investigating the use of low-cost waste oil as a feedstock. The impact of heating temperature on biodiesel yield and trace metal levels is examined using response surface methodology (RSM). Optimal conditions for high biodiesel yields (95–98%) from canola oil are determined with a methanol/oil ratio of 12:1, 1 wt% catalyst, and 60-min reaction time. For crude bioglycerol, the optimal conditions involve a methanol/oil ratio of 4.25:1, 2.93 wt% catalyst, and 119.15-min reaction time. Elemental analysis reveals the presence of high-concentration metals like Cu and Zn and low-concentration ones such as Pb, As, Se, and Zr in both oil feedstocks and their respective biodiesel and bioglycerol products. The study demonstrates that thermal stress on canola oil significantly impacts biodiesel and bioglycerol yields and trace metal levels during the transesterification process. The findings contribute to enhancing cost-effectiveness and environmental sustainability in biodiesel production.