Restarting your device can help fix minor issues and may help the S Pen connect again. On devices with a regular Power key, press and hold the Power key until the Power menu is displayed. Tap the Power icon at the top of the screen, and then tap Rest...
Back up your device and return it to it's default factory settings via Settings > General Management > Reset > Factory Data Reset
Try this, if it doesn't work, contact helpdesk.
Regards,J Wick