To be honest I'm completely lost at this one. I cannot reproduce the problem, I cannot change the camera direction while looking at the 2D panels and in the code it's just a simple SetCameraDefaultDirection call, nothing "magic" here. Of course "Focus Cockpit" should fix it as it puts your camera into the cockpit, the question is how you managed it to have the camera not in cockpit mode while you're in the cockpit?

Perhaps the next beta will help, I don't know...
Cheers
Tschachim