There is a slight mistake in your argument: taking the first derivative, making it vanish, and then checking the second derivative is a recipe to find the local maxima/minima of the function, not the global maxima/minima.
Finding the global maxima is an altogether different task. You have to collect the local maxima and compare them in order to find the global maxima(which will work only if the function is bounded). Mostly, one must find global maxima using some rough sketch of the graph.
Your function is a cubic polynomial, namely:$y = x^3 - 5x^2 + 2$
You can make a rough sketch as follows:
Calculate the first derivative and make it vanish. This implies:
$3x^2 - 10x = 0$
Thus, we get x=3.33 and 0 as the points of extrema
Calculate the second derivative and check the sign of it at the points of
extrema. Here, the second derivative is:
6x-10
We get negative sign at x = 0 and positive sign at x = 3.33
Thus, from negative infinity, the function rises till x=0, sees a small dip
till x=3.33 and then rises upwards till infinity.
Another explanation for this is that x^3 dominates over x^2 and x: it can
be seen clearly that for values greater than 1: $x<x^2<x^3$. Hence, the graph
of the function will be dominated by x^3 and be taken to infinity.
Attached here is a graph of the function for reference:
https://www.desmos.com/calculator/yg8h18wvuz