Solution to maximization not Pareto efficient
An example with two agents and two goods: let
$$
U_1(x) = 0, \hskip 20pt U_2(x) = x_1+x_2, \hskip 20pt w = (1,1).
$$

In this case allocating all the goods, so (1,1) to the first consumer solves the above problem. Even though any other feasible allocation fulfills the conditions, none of them gives a higher utility to the first consumer.

Yet this allocation is clearly not Pareto-optimal, allocating (1,1) to the second consumer would be a Pareto-improvement.