Hi, thanks for writing to HCM.
From the description, Your symptoms of electrical shock
sensation is due to IRRITATION OF NERVE ROOT
possibly due to the pressure exerted on it while changing postures.
As it is not present continuously, its not a matter of concern. I think it should resolve spontaneously with time. The only way to get rid of the symptoms is to avoid those positions causing you the shock like feel.
If you are still concerned, consult a neurophysician for further management.
Hope this information is helpful. Good day