It is not true for non locally-connected sets. Take a path $\gamma$ in $\mathbb{R}^2$ with one end that accumulates to a subsegment of $\gamma$ (in a $\sin(1/x)$ way). Take the product of $\gamma$ with $\mathbb{R}$, and add the interior of $\gamma$ times $\{0\}$.
If you want it to be compact, take $\gamma\times\{0\}$ union with a cone based on $\gamma$.
Note that $\gamma$ is also a weird example of a compact set of the plane that is pathwise connected, simply connected, and whose complement has two connected components.