Finding Lonely Primes
C (gcc), 159 158 149 145 bytes

Saved a byte thanks to xanoetux; removing one newline character.
Saved nine thirteen bytes thanks to ceilingcat; golfing a break condition.


P(n,d,b){for(d=b=1&lt;n;n&gt;++d;)b*=n%d&gt;0;n=b;}F(w,i){w=P(i)&amp;!(P(i-w)|P(i+w)|i%w&gt;1&amp;(P(--i)|P(i-w)|P(i+w))|++i%w&gt;0&amp;(P(++i)|P(i-w)|P(i+w)))?i-1:F(w,i);}

Try it online!