This work describes the optimization of the synthesis of carbon-supported heterogeneous catalysts containing CaO and MgO derived from ornamental stone waste (OSW) in view of their use for biodiesel production. The catalysts were prepared by mixing the OSW and coconut shell activated carbon (CSAC) powders with a NaOH solution under constant stirring; the mixture was then subjected to thermal treatments in an inert atmosphere. The variables of the synthesis process (thermal treatment temperature, residence time, and OSW/CSAC mass ratio) were analyzed using 23 full factorial designs; the response variable was the biodiesel conversion, monitored by solution 1H nuclear magnetic resonance (NMR) spectroscopy. The presence of the phases CaO, MgO, Na2CO3, Na2Ca-(CO3)2, and Ca-(OH)2 (in amounts depending on the synthesis conditions) was identified by X-ray diffraction and solid-state 23Na NMR. The biodiesel conversion varied between 47 and 85%, with the highest value corresponding to the catalyst prepared using an OSW/CSAC mass ratio of 50:20 and thermally treated at 800 °C for 1 h. The main benefit of using the porous carbon support for the catalytically active phases was the significant reduction in the number of metals leached into the produced biodiesel.