The nonlinear dust-ion-acoustic (DIA) solitary structures have been studied in a dusty plasma, including the Cairns-Gurevich distribution for electrons, both negative and positive ions, and immobile opposite polarity dust grains. The external magnetic field directed along the z-axis is considered. By using the standard reductive perturbation technique and the hydrodynamics model for the ion fluid, the modified Zakharov–Kuznetsov equation was derived for small but finite amplitude waves and was provided the solitary wave solution for the parameters relevant. Using the appropriate independent variable, we could find the modified Korteweg–de Vries equation. By plotting some figures, we have discussed and emphasized how the different plasma values, such as the trapping parameter, the positive (or negative) dust number density, the non-thermal electron parameter, and the ion cyclotron frequency, can influence the solitary wave structures. In addition, using the bifurcation theory of planar dynamical systems, we have extracted the centre and saddle points and illustrated the phase portrait of such a system for some particular plasma parameters. Finally, we have graphically investigated the behaviour of the solitary energy wave by changing the plasma values as well as by calculating the instability criterion; we have also discussed the growth rate of the solitary waves. The results could be useful for studying the physical mechanism of nonlinear propagation of DIA solitary waves in laboratory and space plasmas where non-thermal electrons, pair-ions, and dust particles can exist.