The Grey Wolf Optimizer (GWO) algorithm is recognized for its simplicity and ease of implementation, and has become a preferred method for solving global optimization problems due to its adaptability and search capabilities. Despite these advantages, existing Unmanned Aerial Vehicle (UAV) path planning algorithms are often hindered by slow convergence rates, susceptibility to local optima, and limited robustness. To surpass these limitations, we enhance the application of GWO in UAV path planning by improving its trajectory evaluation function, convergence factor, and position update method. We propose a collaborative UAV path planning model that includes constraint analysis and an evaluation function. Subsequently, an Enhanced Grey Wolf Optimizer model (NI–GWO) is introduced, which optimizes the convergence coefficient using a nonlinear function and integrates the Dynamic Window Approach (DWA) algorithm into the model based on the fitness of individual wolves, enabling it to perform dynamic obstacle avoidance tasks. In the final stage, a UAV path planning simulation platform is employed to evaluate and compare the effectiveness of the original and improved algorithms. Simulation results demonstrate that the proposed NI–GWO algorithm can effectively solve the path planning problem for UAVs in uncertain environments. Compared to Particle Swarm Optimization (PSO), Artificial Bee Colony (ABC), GWO, and MP–GWO algorithms, the NI–GWO algorithm can achieve the optimal fitness value and has significant advantages in terms of average path length, time, number of collisions, and obstacle avoidance capabilities.