Lemma: for an odd prime $q,$ we always have
$$ (-3|q) = (q |3). $$
Proof: if $q \equiv 1 \pmod 4,$ then
$$ (-3|q) = (-1|q)(3|q) = (3|q) = (q|3). $$
If $q \equiv 3 \pmod 4,$ then
$$ (-3|q) = (-1|q)(3|q) = -(3|q) = (q|3). $$
In the lemma, $3$ can be replaced by any prime $r \equiv 3 \pmod 4.$
Let $n = 2k+1.$ We have $1 + 3^n = 1 + 3 (3^k)^2 = 1 + 3 w^2.$ If $p \equiv 2 \pmod 3$ and
$$ x^2 + 3 y^2 \equiv 0 \pmod p, $$ assume $y$ is not divisible by $p.$
Then $y$ has a multiplicative inverse $\pmod p.$
$$ x^2 \equiv -3 y^2 \pmod p, $$
$$ \frac{x^2}{y^2} \equiv -3 \pmod p, $$
$$ \left( \frac{x}{y} \right)^2 \equiv -3 \pmod p. $$
This contradicts $p \equiv 2 \pmod 3,$ so actually $y$ is divisible by $p.$ It follows that $x$ is also divisible by $p.$
Back to the original problem, we have $p \equiv 2 \pmod 3$ and
$$ 1 + 3 w^2 \equiv 0 \pmod p.$$
However, this implies $1$ is divisible by $p,$ which is false
====================================================================
The easy proposition is this: we are given a quadratic form
$$ a x^2 + b x y + c y^2 $$ with discriminant
$$ \Delta = b^2 - 4 a c,$$ finally an odd prime $q$ such that
$$ (\Delta | q) = -1. $$
IF
$$ a x^2 + b x y + c y^2 \equiv 0 \pmod q $$ THEN both
$$ x,y \equiv 0 \pmod q, $$ and we get the extra
$$ a x^2 + b x y + c y^2 \equiv 0 \pmod {q^2} $$