Let me know if I missed anything, but I think what you asked is actually a  result by C.Fefferman in reponse to "finiteness principle"[Fefferman1] of interpolation if we do following observations.

> **Claim:** As long as we proved some $\omega$-continuity for the Hessian $D^2h$ i.e. we have an extension $h\in C^{2,\omega}(\mathbb{R}^d)$, then the spectrum of Hessian will not
> oscillate too much in a small neighborhood in $\mathbb{R}^d$ of
> $C_M\cup C_N$ in form of $$\{ x\in\mathcal{R}^d:dist(x,C_M\cup C_N)\leq\epsilon \},\epsilon>0,dist(x,S):=inf_{y\in
> S}d_{\mathbb{R}^d}(x,y)$$

This is true because following observations. The Hessian $D^2h$ is symmetric under your assumption, due to [Hoffman-Wielandt Theorem][1], as long as the entries $\frac{\partial^2h}{\partial x_i^{2}},\frac{\partial^2h}{\partial x_i x_j}$ do not oscillate too much in the neighborhood, the spectrum of Hessian will not oscillate too much. Thus the positivity of $D^2h$ is preserved in such a neighborhood since $h$ coincide with $f\cup g$ on $C_M\cup C_N$ while $f\cup g$ is known to possess positivity in their Hessian.

But the entries will not oscillate too much in a small neighborhood of $C_M\cup C_N$ if $h\in C^{2,\omega}(\mathbb{R}^d)\subset C^2(\mathbb{R}^d)$ ($h$'s second derivative has $\omega$-continuity).

So it suffices to find such an $h\in C^{2,\omega}(\mathbb{R}^d)$. The norm defined on this space is $$\left\Vert F\right\Vert _{C^{m,\omega}(\mathbb{R}^{n})}=max\left\{ \left\Vert F\right\Vert _{C^{m}(\mathbb{R}^{n})},max_{|\beta|=m}sup_{x,y\in\mathbb{R}^{n},0<|x-y|\leq1}\frac{|\partial^{\beta}F(x)-\partial^{\beta}F(y)|}{\omega(|x-y|)}\right\}$$ according to [Fefferman2],(there is a typo in my comment so I deleted it.) and the usual Sobolev norm $$\left\Vert F\right\Vert _{C^{m}(\mathbb{R}^{n})}=max_{|\beta|\leq m}sup_{x\in\mathbb{R}^{n}}|\partial^{\beta}F(x)|$$ where $m=2$ in our case.

Now yield the *Theorem 1* of [Fefferman1] by letting tolerance $\sigma\equiv 0$ and the Whitney $\omega$-convexity is trivially satisfied in this case. I would like to hear your motivation if possible.

[Fefferman1]Fefferman, Charles. "A generalized sharp Whitney theorem for jets." Revista Matematica Iberoamericana 21.2 (2005): 577-688.

[Fefferman2]Fefferman, Charles. "Extension of $ C^{m,\ omega} $-Smooth Functions by Linear Operators." Revista Matematica Iberoamericana 25.1 (2009): 1-48.


  [1]: http://math.stackexchange.com/questions/1711713/hoffman-wielandt-theorem-proof
-----
**This answer does not solve the OP's problem, please see our comment below.**