When written in the language of exterior algebra, Maxwell-Thomson equation writes as $dB=0$ where $d$ is the exterior derivative and $B$ is the magnetic flux 2-form. From Poincaré's lemma, it follows that as $B$ is closed, it is locally exact. Depending on the topology of the domain of interest, $B$ derives from a vector potential 1-form according to $B=dA$.
In Manton and Sutcliffe's Topological Solitons chapter 8, the existence of magnetic monopoles is discussed in the framework of vector analysis and piecewise-defined vector potentials $\vec A_{\pm}$ are derived. As they differ from a gauge term (namely $\vec A_-=\vec A_+-\vec\nabla\left(\frac{g}{2\pi}\phi\right)$), they describe the same physical field.
But when translated into the language of forms, there is something that looks paradoxical. Indeed, as the exterior derivative is a nilpotent operator $d^2\equiv 0$, I wonder how one can simultaneously have $dB=d^2 A=0$ on the one hand and, due to the presence of magnetic monopoles, $dB\neq 0$ on the other hand. I suspect the solution lies in some topological subtleties, but I cannot see what they are. Can anyone help me understand the problem please?