There's something weird going on with Fallout 4's physics when the game's frame-rate fluctuates.
Multiple users on Reddit are reporting a nasty bug that is getting them stuck in hacking terminals in Fallout 4. Basically, once you activate a terminal, finish your hacking and try to exit, you get stuck and can't resume playing.
Judging from the reports I've seen, this error seems to happen mostly to those with high refresh-rate monitors, usually higher than 60Hz. The solution for this, according to user Venusia94, is to set the command "iPresentInterval" to value "0".
You can find this command in the Fallout4Prefs file, which can be found in your game's directory and in Documents\My Games\Fallout4. Make sure you back up the original, and set the edited one to read-only.
If this doesn't work, find a way to limit your frame-rate to something that doesn't cause the game to bug out. Unfortunately, this is a process of trial and error. For some it's 70fps, others it's a 100fps. You can use RivaTuner or MSI Afterburner to limit your fps.