Should the formula for horizontal and vertical shift [$\space g(x)=f(x-a)+b$ ] be restricted to non-linear functions? [EDITED TO CORRECT LEFT/RIGHT CONFUSION]

*

*Let $f$ be a function defined by $f(x)=mx$.

It is possible to produce a horizontal shift of $a$ units to the right  ( provided $a$ is positive)  by defining a  function $g$ such that $g(x)=f(x-a)$.
This horizontal shift also produces a vertical shift, but the formula works inasmuch as the intended horizontal shift occurs.

*

*However, the intended shift does not occur, or occurs not in the intended way,  when one defines a function $h$ as follows : $h(x)= f(x-a)+b$ .

For in that case, the vertical shift perturbates, so to say, the intended horizontal shift.

*

*Hence my question: should one say that the rule " $h(x)=f(x-a)+b$ produces a horizontal shift of $a$ units ( to the left or to the right, depending on the sign of $a$)  and a vertical shift of $b$ units ( up or down) " only works  for non-linear functions?

Note : my question does not deal with the vertical shift , which , apparently, always occurs in the intended way.
Below, an xample, with an intended shift of $4$ units ( to the right) and an actual shift of $5$ units.
https://www.desmos.com/calculator/nd7uu4wnug

 A: The simple fact is that if $f$ is linear, you can't retrieve the horizontal and vertical components of the shift just by looking at the graph. But we can still describe a transormation in terms of horizontal and vertical shifts; it's just that this description is not uniquely determined. There is no paradox here.
A: $f(x) \longrightarrow f(x -a)$ for $a \ge 0$ is a shift of $a$ units to the right, not to the left. This is because $f(x) = f((x + a) - a)$.
Your function now follows the expected outcome.
$$mx \longrightarrow m(x-a) + b, \; a, b, \ge 0$$ will produce a rightward shift of $a$ units and upward shift of $b$ units.

The red line indicates $f(x)$, the green line indicates $f(x - 4)$ and the blue line indicates $f(x - 4) + 2.3$.
A: Both other answers are right, I just point out something more general and something more specific to your example:
Generally, for a linear function with slope $m$, a ("horizontal") shift by $a$ units to the right is the same as a ("vertical") shift by $m \cdot a$ units down; and a ("vertical") shift by $b$ units up is the same as a ("horizontal") shift by $\frac{b}{m}$ units to the left. Or, purely algebraically, if $f(x) = mx + c$, then
$$f(x-a) = mx-ma+c = f(x) -ma, \;\text{ and } \\ f(x)+b = mx+b+c = m(x+\frac{b}{m})+c= f(x+\frac{b}{m})$$
Specifically, for your example function $f(x) =-2.4x$, your combined shift of $4$ units to the right and $2.3$ units up,
$$f(x-4) + 2.3,$$
can also be expressed as as shift of $4 +  \frac{2.3}{2.4} = 4.958\bar 3 \approx 4.96$ (not $5$, look closer!) units to the right,
$$=f(x -4.958\bar3),$$
or as a shift of $(-2.4) \cdot (-4) + 2.3=11.9$ units up,
$$=f(x) +11.9$$
(check the $y$-intercept of the new function). Or, as infinitely many other combinations of vertical and horizontal shifts, for example
$$=f(x+0.4)+12.9 = f(x-17)-28.9= ... ... .$$
