Given a function $f(x)$ such that $\lim_{x \to a} f(x) = k$ exists and a function $g(x, y)$, is it true that $$ \lim_{(x, y) \to (a,b)} g(f(x), y) = \lim_{y \to b} g\left(\lim_{x \to a} f(x), y\right) = \lim_{y \to b} g(k, y)$$ For example, if this were true, we could apply this approach to the limit below (where $(a, b) = (0, 2)$, $f(x) = (1 + x)^\frac{1}{x}$, $g(x, y) = x^y$) to get the correct answer $e^2$: $$ \lim_{(x, y) \to (0, 2)} (1 + x)^{\frac{y}{x}} = \lim_{y \to 2} \left(\lim_{x \to 0}(1 + x)^{1/x}\right)^y = \lim_{y \to 2} e^y = e^2 $$
Is this approach generally applicable in cases where the limit is the composition of a function in $x$ and a function in $y$? If not, are there any counterexamples?