This research presents a multi-strategy augmented dung beetle algorithm (CDBO) for UAV path planning in intricate 3D environments. Its main objective is to address the path planning challenge by formulating an integrated cost function model and environment representation that aligns the optimisation task with the navigation prerequisites and safety constraints of the UAV. Firstly, the algorithm initialises the particle population based on the Lévy flight principle to improve the species diversity and adequately search the solution space. Subsequently, an exponentially decreasing inertia weighting strategy is introduced to improve the convergence speed of the algorithm. In addition, the algorithm uses an adaptive [Formula: see text]-distribution with perturbed variation of the updated positions so that the algorithm avoids falling into a local optimum. Finally, to enhance the robustness of the system, the algorithm incorporates an elite retention strategy based on the Pareto principle. In this study, rigorous tests using 12 CEC2022 test functions and Wilcoxon rank sum test are conducted as benchmarks for the performance of the algorithm. The results show that the enhanced dung beetle algorithm outperforms the traditional algorithm, highlighting its efficiency and robustness. In addition, the efficacy of the enhanced dung beetle algorithm was validated in a variety of complex 3D environments, affirming its ability to generate optimal paths. This study further highlights the importance of effective algorithms in UAV path planning, addressing the key issue of optimising flight operations in intricate spatial scenarios.