
It is important to keep in mind what the Lagrange-multiplier method does: it locates points of the "level curves" of a function where the normal vector (gradient) is parallel (or anti-parallel) to the normal vector of the constraint function. For a single-variable function, this reduces to looking for points where the slopes of the curves match.
But in applying this method to an inequality constraint, we must consider what happens for the case of the equation (if the inequality is improper) and for the inequality. For either $ \ g(x) \ $ or $ \ h(x) \ $, the equality only gives us the single value $ \ x \ = \ 3 \ $ ; as you already found, the slope of either function does not equal $ \ f \ '(3) \ $ . Investigating the inequalities, $ \ g(x) \ > \ 0 \ $ or $ \ h(x) \ > \ 0 \ $ requires that $ \ x \ < \ 3 \ $ , since both have odd symmetry about $ \ x \ = \ 3 \ $ .
From $ \ f \ '(x) \ = \ 3x \ (3x-2) \ $ and $ \ f \ ''(x) \ = \ 6(3x - 1) \ $ , we see that $ \ f(x) \ $ only decreases on $ \ (0 \ , \ \frac{2}{3}) \ $ , that is, between its one local maximum (at $ \ x \ = \ 0 $ , the "concavity" failing to change) and its one local minimum (at $ \ x \ = \ \frac{2}{3} $ ); $ \ f(x) \ $ is strictly increasing everywhere outside of $ \ [0 \ , \ \frac{2}{3}] \ $ . If we look at $ \ f \ '(x) \ = \ g \ '(x) \ $ , we find
$$ 9x^2 \ - \ 6x \ = \ -27 \ + \ 18x \ - \ 3x^2 \ \ \Rightarrow \ \ 4x^2 \ - \ 8x \ + \ 9 \ = \ 0 \ \ , $$
for which the discriminant is $ \ -80 \ $ ; thus, there is no value of $ \ x \ $ for which the slopes of $ \ f(x) \ $ and $ \ g(x) \ $ agree. For $ \ f \ '(x) \ = \ h \ '(x) \ $ ,
$$ 9x^2 \ - \ 6x \ = \ -1 \ \ \Rightarrow \ \ 9x^2 \ - \ 6x \ + \ 1 \ = \ (3x - 1)^2 \ = \ 0 \ \ , $$
so the single point where the slopes of $ \ f(x) \ $ and $ \ h(x) \ $ match is at $ \ x \ = \ \frac{1}{3} \ $ , which we have found from the above to be the one inflection point of $ \ f(x) \ $ .
This is a detailed justification of why there is a problem. The Lagrange-multiplier method will not be of help in such situations; "re-formulating" the constraint matters when the directions of the gradients of the functions don't "agree" anyway. For this problem, we would need to argue instead that under the constraint given by either $ \ g(x) \ \ge \ 0 \ $ or $ \ h(x) \ \ge \ 0 \ $ that, given the properties we have found for $ \ f(x) \ $ , the maximum value of the function lies at the endpoint of $ \ ( -\infty \ , \ 3] \ $ , which is $ \ f(3) \ = \ 54 \ $ .