Compositeness test for specific class of $N=k \cdot b^n-1$

Can you give a counterexample to the conjecture given below ?

Def 1.

Let $P_m(x)=2^{-m}\cdot \left(\left(x-\sqrt{x^2-4}\right)^{m}+\left(x+\sqrt{x^2-4}\right)^{m}\right)$ .

Def 2.

Let $N=k \cdot b^n-1$ such that $k>0$ , $3 \not\mid k$ , $b>0$ , $b$ is even number, $3 \not\mid b$ and $n > 2$ .

Def 3.

Let $S_i=P_b(S_{i-1})$ with $S_0=P_{kb/2}(P_{b/2}(4))$

Conjecture

If $N$ is prime then $S_{n-2} \equiv 0\pmod{N}$.

You can run this test here .

Let us prove by induction that $$S_i=p^{kb^{i+2}/4}+q^{kb^{i+2}/4}$$ where $p=2-\sqrt 3,q=2+\sqrt 3$ with $pq=1$. \small\begin{align}S_0&=P_{kb/2}(P_{b/2}(4))\\\\&=P_{kb/2}\left(p^{b/2}+q^{b/2}\right)\\\\&=2^{-kb/2}\left(p^{b/2}+q^{b/2}-\sqrt{(p^{b/2}+q^{b/2})^2-4}\right)^{kb/2}+2^{-kb/2}\left(p^{b/2}+q^{b/2}+\sqrt{(p^{b/2}+q^{b/2})^2-4}\right)^{kb/2}\\\\&=2^{-kb/2}\left(p^{b/2}+q^{b/2}-\left(q^{b/2}-p^{b/2}\right)\right)^{kb/2}+2^{-kb/2}\left(p^{b/2}+q^{b/2}+\left(q^{b/2}-p^{b/2}\right)\right)^{kb/2}\\\\&=p^{kb^2/4}+q^{kb^2/4}\end{align}
Supposing that $S_i=p^{kb^{i+2}/4}+q^{kb^{i+2}/4}$ gives that \small\begin{align}S_{i+1}&=P_b(S_i)\\\\&=P_b(p^{kb^{i+2}/4}+q^{kb^{i+2}/4})\\\\&=2^{-b}\left(p^{kb^{i+2}/4}+q^{kb^{i+2}/4}-\sqrt{(p^{kb^{i+2}/4}+q^{kb^{i+2}/4})^2-4}\right)^{b}\\\\&\qquad+2^{-b}\left(p^{kb^{i+2}/4}+q^{kb^{i+2}/4}+\sqrt{(p^{kb^{i+2}/4}+q^{kb^{i+2}/4})^2-4}\right)^{b}\\\\&=2^{-b}\left(p^{kb^{i+2}/4}+q^{kb^{i+2}/4}-\left(q^{kb^{i+2}/4}-p^{kb^{i+2}/4}\right)\right)^{b}\\\\&\qquad+2^{-b}\left(p^{kb^{i+2}/4}+q^{kb^{i+2}/4}+\left(q^{kb^{i+2}/4}-p^{kb^{i+2}/4}\right)\right)^{b}\\\\&=p^{kb^{i+3}/4}+q^{kb^{i+3}/4}\qquad\blacksquare\end{align}
Now $$S_{n-2}=p^{(N+1)/4}+q^{(N+1)/4}$$ Squaring the both sides gives $$S_{n-2}^2=p^{(N+1)/2}+q^{(N+1)/2}+2\tag1$$ Using that $$\sqrt{2\pm\sqrt 3}=\frac{\sqrt 3\pm 1}{\sqrt 2}$$ we get \begin{align}2^{(N+1)/2}(p^{(N+1)/2}+q^{(N+1)/2})&=(\sqrt 3-1)^{N+1}+(\sqrt 3+1)^{N+1}\\\\&=\sum_{i=0}^{N+1}\binom{N+1}{i}(\sqrt 3)^{i}((-1)^{N+1-i}+1^{N+1-i})\\\\&=\sum_{j=0}^{(N+1)/2}\binom{N+1}{2j}(\sqrt 3)^{2j}\cdot 2\\\\&\equiv 2+2\cdot 3^{(N+1)/2}\qquad\pmod N\\\\&\equiv 2+2\cdot (-3)\qquad\pmod N\\\\&\equiv -4\qquad\pmod N\end{align} where $$3^{(N+1)/2}=3\cdot 3^{(N-1)/2}\equiv 3\left(\frac 3N\right)=3\cdot\frac{(-1)^{\frac{3-1}{2}\cdot\frac{N-1}{2}}}{\left(\frac N3\right)}=3\cdot\frac{-1}{1}=-3\pmod N$$ Since $$2^{(N+1)/2}=2\cdot 2^{(N-1)/2}\equiv 2\left(\frac 2N\right)=2\cdot (-1)^{(N^2-1)/8}\equiv 2\pmod N$$ is coprime to $N$, we get $$p^{(N+1)/2}+q^{(N+1)/2}\equiv -2\pmod N\tag2$$ It follows from $(1)(2)$ that $$S_{n-2}\equiv 0\pmod N$$ as conjectured.