The quantity is only Weyl invariant on closed manifolds (with \(\partial M = 0\)). When the manifold has a boundary, the Weyl invariant quantity (Euler characteristic) is
\[\chi = \frac{1}{4\pi} \int_M d^2 \sigma \sqrt{-\gamma } R [ \gamma ] + \frac{1}{2\pi} \int_{\partial M} ds k\]
Here, $k$ is the extrinsic curvature of the boundary given by
\[k = \pm n_b t^a \nabla_a t^b\]
where $t^a$ is the unit vector tangent to the boundary with $t^2 = \mp 1$, $n^a$ is the outward pointing unit normal ($n^2 = 1$ and $n \cdot t = 1$). The upper sign is for a Lorentzian world-sheet and lower one for a Euclidean one). Now, under a Weyl transformation
\[ds' \to e^{\omega} ds,~~~n'_a = e^\omega n_a,~~~ t'^a = e^{-\omega} t^a \implies ds' k' = ds k + ds n^b \nabla_b \omega \]
Combining this with the result you derived, we find that $\chi$ is Weyl invariant.