This is an outgrowth of this question.

For a (metrizable) space $X$ consider the following increasingly strong properties:

(i) For every compact $K\subset X$ there is a map $f:X\to X$ such that $K\subset f(X)$ and $f(X)$ is relatively compact in $X$.

(ii) For every compact $K\subset X$ there is a map $f:X\to X$ which is the identity on $K$ and $f(X)$ is relatively compact in $X$.

(iii) For every compact $K\subset X$ there is a compact $L$ that contains $K$ and which is a retract of $X$ (this property was in the focus of the original question).

Obviously every compact space satisfies (iii).

As was pointed out in the comments to the linked question, among examples of spaces that does not satisfy (i) are so-called connected punctiform spaces, i.e. such that have no connected compact subsets other than singletons. If $X$ is such a space, and $K$ is a set of two points, then $\overline{f(X)}$ has to be connected, compact and contain these two points, which gives a contradiction.

Again, as was pointed out in the comments, connected punctiform spaces can be analytically as good as polish, so the problem has to have a geometric flavor. This is supported by the fact (as was pointed in the original question) that every closed convex subset of a locally convex space satisfies (iii). In my opinion the next step is the class of ANR's.

Does every ANR satisfy any of the properties (i), (ii) or (iii)? How about open sets in locally convex spaces?

I would like to present another example of a space that does not satisfy (i). Let $Y$ be a continuum constructed in Mackowiak - Singular arc-like continua. It has a lot of cool features, what is relevant here is that it is embeddible into a plane, hereditarily decomposable and if $L\subset Y$ is a subcontinuum, and $g:L\to Y$, then either $g(L)=L$ and $g$ is the identity, or $g(L)$ is a singleton.

Let $X=Y\backslash\{y\}$, for arbitrary $y$. Using the properties of $Y$ one can show that the only non-constant continuous map $f:X\to X$ is the identity. Now arguing as above, we can see that $X$ does not satisfy (ii). This example is valuable, because $Y$ satisfies (iii) being compact, and yet removing a single point destroys even (i). Moreover, since $Y$ is compact and embeddible into the plane, $X$ is embeddible into a punctured plane as a closed set. One can show that the latter satisfies (iii), while $X$ doesn't satisfy (i). Hence, (i)-(iii) is not stable with respect to taking closed or open subsets.