I just say Amit's comment on this question: The second welfare theorem without monotonicity so I got curious and tried to find both the contract curve for that particular problem, and the Walrasian equilibria when both agents have the endowments $(w_x,w_y)=(2,2)$.
The problem regarding Amit's comment is
$u_i(x_i,y_i) = - (x_i-1)^2 - (y_i-1)^2$
$w_x = 4$
$w_y = 4$
Since the utility function (in this case the same one for both agents) is differentiable everywhere and non linear, using $MRS_1 = MRS_2$ and the endowment constraints gives me the contract curve. Doing this procedure I got that the contract curve is $y_1 = x_1$.
Clearly the allocation $((x_1,y_1),(x_2,y_2)) = ((2,2),(2,2))$ belongs to the contract curve.
However, Amit said in his comment that the alocation $((x_1,y_1),(x_2,y_2)) = ((2,2),(2,2))$ is not a competitive equilibrium.
My curiosity led me to do the experiment of trying to find the Walrasian Equilibrium for the problem above, given the endowments as the allocation $((w_{x1},w_{y1}),(w_{x2},w_{y2})) = ((2,2),(2,2))$.
I started computing the consumers' demands as usual.
Since both consumers have the same utility function and endowments, solving this optimization problem would yield me the demand functions for both consumers:
$\max -(x-1)^2-(y-1)^2$
s.t. $p_x x + p_y y = 2 p_x + 2 p_y$
Using the $MRS = \frac{p_x}{p_y}$ shortcut,
$\frac{\frac{\partial u_i}{\partial x}}{\frac{\partial u_i}{\partial y}} = \frac{p_x}{p_y} \implies \frac{-2 (x-1)}{-2(y-1)} = \frac{p_x}{p_y} \implies \frac{x-1}{y-1} = \frac{p_x}{p_y} \implies x-1 = \frac{p_x}{p_y}(y-1) \implies x = \frac{p_x}{p_y} (y-1) + 1$
$\implies x = \frac{p_x}{p_y} y - \frac{p_x}{p_y} + 1$
Plugging this expression for $x$ into the budget constraint,
$p_x (\frac{p_x}{p_y} y - \frac{p_x}{p_y} + 1) + p_y y = 2 p_x + 2 p_y \implies \frac{{p_x}^2}{p_y} y - \frac{{p_x}^2}{p_y} + p_x + p_y y = 2 p_x + 2 p_y$
$\implies (\frac{{p_x}^2}{p_y} + p_y) y = 2 p_x + 2 p_y + \frac{{p_x}^2}{p_y} - p_x \implies y = \frac{2 p_x + 2 p_y + \frac{{p_x}^2}{p_y} - p_x}{\frac{{p_x}^2}{p_y} + p_y}$
For simplicity let's take as numeraire $p_y = 1$
$\implies y = \frac{2 p_x + 2 + {p_x}^2 - p_x}{{p_x}^2 + 1}$
Simplifying to get the demands for good $y$
${y_1}^\star = {y_2}^\star = \frac{{p_x}^2 + p_x + 2}{{p_x}^2 + 1}$
The previous expression for $x$ after taking into account $p_y = 1$ is the numeraire becomes
$x = p_x y - p_x + 1$
Substituting the demand for $y$ into this expression
$\implies x = p_x (\frac{{p_x}^2 + p_x + 2}{{p_x}^2 + 1} - 1) + 1 \implies x = p_x \cdot \frac{{p_x}^2 + p_x + 2 - {p_x}^2 - 1}{{p_x}^2 + 1} + 1 \implies x = p_x \cdot \frac{p_x + 1}{{p_x}^2 + 1} + 1 \implies x = \frac{{p_x}^2 + p_x + {p_x}^2 + 1}{{p_x}^2 + 1} \implies {x_1}^\star = {x_2}^\star = \frac{2 {p_x}^2 + p_x + 1}{{p_x}^2 + 1}$
The equilibrium condition on good $y$ is
${y_1}^\star + {y_2}^\star = 4 \implies 2 \cdot \frac{{p_x}^2 + p_x + 2}{{p_x}^2 + 1} = 4 \implies \frac{{p_x}^2 + p_x + 2}{{p_x}^2 + 1} = 2 \implies {p_x}^2 + p_x + 2 = 2 {p_x}^2 + 2 \implies p_x = {p_x}^2$
$\implies {p_x}^2 - p_x = 0 \implies p_x (p_x - 1) = 0$
From here we get $p_x = 1$ or $p_x = 0$.
Substituting $p_x = 0$ into the equilibrium condition for good $x$ yields a contradiction, while $p_x = 1$ works.
Therefore, ${p_x}^\star = 1$ is the only equilibrium relative price.
Substituting ${p_x}^\star = 1$ into each demand function yields the allocation $((x_1,y_1),(x_2,y_2)) = ((2,2),(2,2))$
This would imply that $((x_1,y_1),(x_2,y_2)) = ((2,2),(2,2))$ is the equilibrium allocation supported by the relative prices $\frac{{p_x}^\star}{{p_y}^\star} = 1$, contradicting Amit's comment.
Is it wrong to apply any of the usual methods for non monotonic utility functions?
I plotted the situation on GeoGebra, which makes it seem like my results are correct:
Geogebra's axes: Agent A's axes
Orange axes: Agent B's axes
Purple line: Contract curve
Blue points: Bliss point for each agent, as the labels say
Red circle: A's indifference curve
Black circle: B's indifference curve
Green line: Price line $\frac{{p_x}^\star}{{p_y}^\star} = 1$, passing through the allocation $((x_1,y_1),(x_2,y_2)) = ((2,2),(2,2))$, which is indeed tangent to both agents' indifference curves.