You have to take into account that fermionic fields are anticommuting objects.
The general form of a CP-transformation acting on the quark fields (mass eigenfield) reads $$u(x) \stackrel{\rm CP}{\to} e^{i \alpha_u} C u^\ast(\tilde{x}), \quad d(x) \stackrel{\rm CP}{\to} e^{i\alpha_d} C d^\ast(\tilde{x}), \qquad x=(x^0, \mathbf{x}), \, \tilde{x}=(x^0, -\mathbf{x}), \, C=-i \gamma^2\gamma^0,$$ where all quarks with (electromagnetic) charge $+2/3$ are collected in the $n_G=3$ dimensional column vector $u$ and, analogously, the quarks with charge $-1/3$ in $d$. $e^{i\alpha_u}$ and $e^{i\alpha_d}$ are diagonal $n_G \times n_G = 3 \times 3$ phase matrices, which do not affect the kinetic or mass terms of the quark fields. As a consequence, one obtains $$\bar{u} (x) \gamma^\mu (1-\gamma_5) V_{\rm CKM}\, d(x) \stackrel{\rm CP}{\to} -\varepsilon(\mu)\bar{d}(\tilde{x})\gamma^\mu (1-\gamma_5)(e^{-i\alpha_u}V_{\rm CKM}e^{i\alpha_d})^Tu(\tilde{x}),$$ where $\varepsilon(0)=+1$ and $\varepsilon(i)= -1$ ($i=1,2,3$). The minus sign in this formula originates from the crucial property $u_{i a} d^\ast_{j b}= - d^\ast_{j b} u_{i a}$ of fermionic fields ($i,j$ are generation indices and $a,b$ are Dirac indices).
P.S.: The weak coupling constant $g$, being simply one of the input parameters of the SM, is, of course, not affected by this transformation (acting on the fields).