This study demonstrates the potential for improved accuracy in geomechanical risk assessment by employing rock physics modeling to account for geological effects on sonic velocity logs. Geomechanical models that rely solely on sonic velocity logs without fully considering geological factors such as rock compaction, shale volume, dip angle, and gas saturation can lead to inaccurate wellbore stability evaluations. Using real field logging data from an inclined thin-layered sandstone-shale sequence, we quantitatively evaluated the impact of these factors on sonic velocities through rock physics modeling. These corrected velocity data were then used to construct a more appropriate geomechanical model, resulting in improved accuracy of wellbore stability analysis. Our results highlight the importance of integrating rock physics modeling into geomechanical workflows for enhanced reliability in geomechanical risk assessment of complex reservoirs.