In the course of studying a problem involving counting points on hyperspheres and hyperplanes in dimension $d$ mod $p$, I came across the following interesting pattern
Conjecture/Question: for (odd?) primes $p,d$, for some choice of sign $(\text{sgn}_p^d) \in \{+1, -1\}$, $$p^\frac{d-3}{2}\cdot \Bigg(p^\frac{d-1}2 + (\text{sgn}_p^d) \cdot \begin{cases} -1 \\ p-1 \end{cases} \Bigg) \mod d$$ gives the values $0,1$ in some order (meaning one of the two branches in the 'cases environment' is $0$ and the other is $1$). Which sign is it, and which branch of the 'cases environment' give $0$ and which gives $1$? (So the conjecture is "there exists a sign s.t. ..." and the question is asking "which sign, and which branch ...")
For example, for $p=13,d=19$, the sign is $\text{sgn}_p^d = -1$, and indeed using WolframAlpha one checks that the top branch gives $0$ and the bottom branch gives $1$. If on the other hand we try the sign $= +1$, the top branch gives $6$ and the bottom branch gives $5$.
Here's another phrasing of the above due to user @cnikbesku that is a bit more rigorous and may make a bit more sense:
Conjecture/Question: There exists a function $s:P^2\rightarrow\{-1,1\}$, where $P$ stands for the set of all (maybe odd) prime numbers, such that for all $(p,d)\in P^2$ we have: $$\bigg(p^\frac{d-3}{2}\Big(p^\frac{d-1}2-s(p,d)\Big)\;\text{mod}\;d,\;\;p^\frac{d-3}{2}\Big(p^\frac{d-1}2+s(p,d)\cdot(p-1)\Big)\;\text{mod}\;d\bigg)\in\{(0,1),(1,0)\}.$$ The question is what can we say about whether is it $(0,1)$ or $(1,0)$ for such function $s$?
For example, for $p=13,d=19$, the only possible value for $s(p,d)$ is $-1$, and indeed using WolframAlpha one checks that the pair is $(0,1)$. If on the other hand we try $s(p,d)=1$, the pair becomes $(6,5)$.
Besides isolating the above conjecture/questions, I don't really have any further work/guesses (perhaps Euler's criterion may be helpful, reducing to some Legendre symbols) but I hope that the puzzle itself is interesting enough to warrant staying open.
Your conjecture follows from the Euler's criterion: If $p$ is a prime and $(a,p) = 1$, then $$a^{\tfrac{p-1}{2}}\equiv \begin{cases} 1 \pmod p&\text{if $a$ is a quadratic residue $\bmod p$}\\ -1 \pmod p&\text{if $a$ is a non-quadratic residue $\bmod p$} \end{cases}$$
Also, observe that $a^{\tfrac{p-3}{2}} a = a^{\tfrac{p-1}{2}}\equiv \pm1\pmod p$, so $a^{\tfrac{p-3}{2}}\equiv\pm a^{-1} \pmod p$ where $a^{-1}$ denotes the inverse of $a$ $\bmod p$.
In your case, if $p$ and $d$ are two distinct primes we have two cases:
Then $$p^\frac{d-3}{2} \left(p^\frac{d-1}2 + \begin{cases} -1 \\ p-1 \end{cases}\right) \equiv p^{-1}\left(1+\begin{cases} -1 \\ p-1 \end{cases}\right) = \begin{cases} 0 \\ p^{-1}p\end{cases}\equiv \begin{cases} 0 \\ 1\end{cases}\pmod d$$
Then $$p^\frac{d-3}{2} \left(p^\frac{d-1}2 - \begin{cases} -1 \\ p-1 \end{cases}\right) \equiv -p^{-1}\left(-1-\begin{cases} -1 \\ p-1 \end{cases}\right) = \begin{cases} 0 \\ (-p^{-1})(-p)\end{cases}\equiv \begin{cases} 0 \\ 1\end{cases}\pmod d$$