Get Featured Image Outside Loop Not Working

First you have to make sure the current post ID + 1 and Current post ID – 1 is exactly the post ID of the next and previous posts.

if it is correct then you can use

<img src="https://wordpress.stackexchange.com/questions/244237/<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id($prevID),"full'); echo $image[0];?>" />

and

<img src="https://wordpress.stackexchange.com/questions/244237/<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id($nextID),"full'); echo $image[0];?>" />

The wp_get_attachment_image_src returns an array with image url as the first element of the array

error code: 523