There are other solutions.
In[11]:= Solve[(2 x + 4 y - x^2 - y^2 /. x -> 2) == 0]
Out[11]= {{y -> 0}, {y -> 4}}
Could specify that real solutions are desired.
In[12]:= Solve[2 x + 4 y - x^2 - y^2 == 0, {x, y}, Reals]
During evaluation of In[12]:= Solve::svars: Equations may not give solutions for all "solve" variables.
Out[12]= {{y ->
ConditionalExpression[2 - Sqrt[4 + 2 x - x^2],
1 - Sqrt[5] < x < 1 + Sqrt[5]]}, {y ->
ConditionalExpression[2 + Sqrt[4 + 2 x - x^2],
1 - Sqrt[5] < x < 1 + Sqrt[5]]}, {x -> 1 - Sqrt[5],
y -> 2 - Sqrt[4 + 2 (1 - Sqrt[5]) - (1 - Sqrt[5])^2]}, {x ->
1 + Sqrt[5], y -> 2 - Sqrt[4 + 2 (1 + Sqrt[5]) - (1 + Sqrt[5])^2]}}