In order to solve the problem of insufficient end positioning accuracy due to factors such as gravity and material strength during the inverse solution process of a large hydraulic robotic arm, this paper proposes an inverse solution algorithm based on an adaptive spider wasp optimization (ASWO) optimized back propagation (BP) neural network. Firstly, the adaptability of the SWO algorithm is enhanced by analyzing the phase change in population fitness and dynamically adjusting the trade-off rate, crossover rate, and population size in real time. Then, the ASWO algorithm is used to optimize the initial weights and biases of the BP neural network, effectively addressing the problem of the BP neural network falling into local optima. Finally, a neural network mapping relationship between the actual position of the robotic arm’s end-effector and the corresponding joint values is established to reduce the influence of forward kinematic errors on the accuracy of the inverse solution. Experimental results show that the average positioning error of the robotic arm in the XYZ direction is reduced from (91.3, 87.38, 117.31) mm to (18.16, 24.67, 27.21) mm, significantly improving positioning accuracy by 80.11%, 71.78%, and 76.81%, meeting project requirements.