As mentioned in the comments, we need to fix isomorphisms $\newcommand{\D}{\mathscr{D}}\D_1 \xrightarrow{\sim} \D_1^{op}$ and $\D_2 \xrightarrow{\sim} \D_2^{op}$ for the question to make sense. InThey key point is that in this case, there is a canonical isomorphism $\D_1^{op} \otimes \D_2 \xrightarrow{\sim} \D_2^{op} \otimes \D_1$, inducing equivalences between the categories of $\D_1$-$\D_2$-bimodules and $\D_2$-$\D_1$-bimodules.
Hence one can consider the gluings $\D = \D_1 \times_\varphi \D_2$ and $\D' = \D_2 \times_\psi \D_1$. Here, where $\psi$ is the $\D_2$-$\D_1$-bimodule corresponding to $\varphi$ under the identification $\D_1^{op} \otimes \D_2 \xrightarrow{\sim} \D_2^{op} \otimes \D_1$.
In fact, $\D'$ is nothing but the opposite category of $\D$. OneIndeed one has canonical isomorphisms $$ \D' = \D_2 \times_\psi \D_1 \simeq \D_2^{op} \times_\varphi \D_1^{op} \simeq ( \D_1 \times_\varphi \D_2)^{op} = \D^{op} $$ where the last identification holds in generala functor (without the duality assumptions), see Lemma 7.1 in Kuznetsov-Lunts.
Your construction seems to be fine$\D \to \D'$ as you described, if bywhere $\mu^{op}$ you meanmeans the element of $\mu' \in \psi^0(M_1, M_2)$$\psi^0(M_1, M_2)$ corresponding to $\mu \in \varphi^0(M_2, M_1)$ under the isomorphisms induced by duality. Further this functor $\D \to \D'$ is easily seen to beclearly an equivalence, justswapping the first two components and acting by constructionduality on the third.