First, my apologies if this has been asked before, there are many questions on MSE on Cauchy's Integral Theorem but as far as I searched here and online elsewhere I couldn't seem to find anything on the matter.
Looking over the Wikipedia page for Cauchy's Integral Theorem, in its most general form they state the homotopy version as:
Let ${\displaystyle U\subseteq \mathbb {C} }$ be an open set, and let ${\displaystyle f:U\to \mathbb {C} }$ be a holomorphic function. Let ${\displaystyle \gamma :[a,b]\to U}$ be a smooth closed curve. If ${\displaystyle \gamma }$ is homotopic to a constant curve, then: $${\displaystyle \int _{\gamma }f(z)\,dz=0.}$$
(Here, smooth means piecewise-$C^1$)
I have already seen the proof of this. Of course, from this follows the much more common Cauchy's Integral Theorem on simply connected domains.
Then, on the Wikipedia page they add that:
The Cauchy integral theorem is valid with a weaker hypothesis than given above, e.g. given ${\displaystyle U}$, a simply connected open subset of ${\displaystyle \mathbb {C} }$, we can weaken the assumptions to ${\displaystyle f}$ being holomorphic on ${\displaystyle U}$ and continuous on ${\textstyle {\overline {U}}}$ and ${\displaystyle \gamma }$ a rectifiable simple loop in ${\textstyle {\overline {U}}}$.
I was unable to prove this from the homotopy formulation or the one on simply-connected domains, but my idea is that the proof goes like this (sketch):
Find a homotopy (relative to the empty set) of piecewise-$C^1$ closed curves with the same domains for the $C^1$ segments, $H : [0,1]\times[0,1] \to \overline{U}$ with $H(s,1) \equiv \gamma(s)$ such that its restriction on $[0,1]\times[0,1)$ has its image in $U$. Then, since $f$ is continuous on $\overline U$, $g(t) = \int_{H_t} f(z) dz = {\int\limits_0^1} f(H_t(s)) H_t'(s) ds$ (taken as a sum on the $C^1$ segments' domains) is continuous, so $\int_{\gamma} f(z) dz = \lim_{t\to 1^-} g(t) = 0$. The problem with this is that such a homotopy may not even exist. Think for example of $U$ as an open annulus with a ray removed from its center and $\gamma$ an ellipse through that ray. A solution to this specific case is dividing $\gamma$ into two curves along that ray and considering two homotopies. Such a solution is hard to generalize, however.
The theorem, as stated, is wrong. Your example is on the right direction: if you take $\frac1z$ on the domain you described and you integrate around a loop containing zero, you do not get $0$ for the integral. What is usually stated as a general form of Cauchy's theorem is:
A very straightforward proof is as follows: By Mergelyan's theorem and the fact that $\lim \oint_\gamma f_n=\oint \lim_\gamma f_n$ if the convergence is uniform, it suffices to prove the result for polynomials, and in this case the claim follows form the usual form of Cauchy's theorem.
Another way of proving the result (perhaps more similar in spirit to your idea of finding a homotopy), albeit using a few more advanced results, is as follows: The conformal map $\varphi:\mathbb{D}\to U$ has a continuous extension on $\bar{\mathbb{D}}$ by Caratheodory's theorem. In particular, let us write $\varphi^*$ for the radial limit of $\varphi$ (i.e. $\lim_{r\to 1^{-}}\varphi(re^{it})=\varphi^*(e^{it})$). $\Phi(s,t):=\varphi(se^{2\pi i t})$ is now a homotopy between $\gamma$ and $\varphi(0)$, a point. It remains to prove that this homotopy is "well behaved": by a theorem of Riesz (I do not have a reference at the moment, will add later) $\varphi:\mathbb{D}\to U$ satisfies $\varphi'\in H^1(\mathbb{D})$; By Fatou's theorem the radial limit $\varphi'^*$ exists a.e. it is $L^1(\partial \mathbb{D})$ and $||\varphi'(se^{2\pi it})||_{H^1(\mathbb{D})}=\lim_{s\to 1^{-}}\|\varphi'_s\|_{L^1(\partial \mathbb{D})}=\|\varphi'^*\|_{L^1(\partial \mathbb{D})}$. Again by Riesz we have $l(\gamma)=\int_0^{2\pi}|\varphi'^*(e^{it})|dt$; This implies that $\varphi(e^{it})$ is an absolutely continuous function and that ${\varphi^{*}}'={\varphi'}^{*}$ $$0=\oint_{\Phi(0,t)} f=\lim_{s\to 1^-}\oint_{\Phi(s,t)}f=\lim_{s\to 1^{-}}\int_0^{2\pi}f\circ \varphi(se^{2\pi i t})\varphi'(se^{2\pi it})dt$$ Since $f\circ \varphi$ is uniformly continuous on $\bar{\mathbb{D}}$, DCT implies implies $$\lim_{s\to 1^{-}}\int_0^{2\pi}f\circ \varphi(se^{2\pi i t})\varphi'(se^{2\pi it})dt=\int_0^{2\pi}f\circ \varphi(e^{2\pi it})\varphi'(e^{2\pi it})=\oint_\gamma f(z)dz$$ Where the last equality is motivated by the change of variable formula for absolutely continuous functions.