Do you get any particular error number on the "go to layout" that fails?
Any triggers active on that layout or the one that you are leaving?
Thanks Wim. You hit the nail on the head. My GTL was failing because of a script trigger on the layout I was leaving that I thought was disabled in the script. It turns out that I had a bug that was stopping it from being disabled and was therefore causing the problem.
All fixed. I guess the race condition was with myself