In the current study, an environmentally friendly and energy-efficient synthesis of two coumarin derivatives was achieved using a solvent-free grinding technique. This green protocol offers several advantages over conventional methods, including shorter reaction times, the absence of hazardous solvents, mild conditions, straightforward workup, low cost, and high product yields. The chemical structures of the synthesized derivatives were confirmed by IR, \(\:1\text{H}\) NMR, \(\:13\text{C}\) NMR, and mass spectrometry. The coumarin-based corrosion inhibitors (compounds 3 and 6) were incorporated into a commercial solvent-based primer to enhance its protective properties against corrosion. Dynamic Mechanical Analysis (DMA) revealed an increase in storage modulus (E′) and thermal resistance, particularly in the formulation modified with the pyrazole-containing compound 6, which retained stiffness at elevated temperatures. Complementary thermogravimetric analysis (TGA) confirmed improved thermal stability, as shown by higher degradation onset temperatures and greater char yields in the modified coatings. The inclusion of these compounds significantly improved the mechanical performance of the coated films. Notably, the formulation containing compound 6 exhibited superior hardness, impact resistance, and adhesion, attributed to strong interfacial interactions with the primer matrix. The anticorrosive performance of the modified primers was further evaluated using salt spray testing. Both compounds significantly enhanced corrosion resistance compared to the unmodified primer, with compound 6 providing superior protection. These findings were supported by quantum chemical calculations, which showed that compound 6 exhibited a lower energy gap (ΔE = 1.915 eV), indicating higher reactivity and stronger interaction with the metal surface. Overall, the study demonstrates the dual function of coumarin-based corrosion inhibitors in enhancing both the mechanical integrity and corrosion resistance of commercial primer coatings.