I get this when trying to use any item that changes the games focus, e.g. hacking/using terminals when a companion/npc walks into me during the focus change. The animation of changing the view to use/view the terminal will get stuck as usually dogmeat gets in the way blocking the focus change
Work around is simple, open the console and enable noclip mode