Klee's trick --- more applications
Klee's trick easily follows from Tietze extension theorem, and there is a generalization when $\mathbb R^n$ is replaced by a locally convex linear space $E$, which is based on Dugundji's extension theorem.
Incidentally, the sets $K$, $K^\prime$ need only be closed. Compactness is not required.
A common use of these results is the unknotting of compact sets in certain locally convex linear spaces, namely those where $E$ is homeomorphic to $E\times E$: any homeomorphism of compact sets extends to an ambient homeomorphism.
Another application is to the problem of extending a metric: if $(X, d)$ is a metric space, $A$ is a closed subset of $X$, and the restriction of $d$ to $A\times A$ is equivalent to a metric $\rho$, then $\rho $ extends to a metric on $X$. Moreover, if $d$ and $\rho$ are complete, then so is the extension of $\rho$. Here "equivalent" means that they induce the same topology.
All this can be found in "Selected topics in infinite-dimensional topology" by Bessaga and Pełczyński by tracing from Proposition II.3.2.
This answer is a correction to my comment above. In these notes from Marshall Cohen's course (from Spring 2001), he uses the Klee trick to give a simple proof that if $f, g: X \to S^n$ are non-surjective embeddings with $X$ compact, then the integral homology of $S^n - f(X)$ is the same as that of $S^n - g(X)$. From this he gave simple deductions of Invariance of Domain (showing that $\mathbb{R^k}$ does not embed into $\mathbb{R^n}$ if $k>n$ and the Jordan-Brouwer separation theorem for embeddings of $S^{n-1}$ into $S^n$.