I had the same issue, however mine was caused by one of the Panes loading content (using .LoadContentFrom("PartialViewName")) from a PartialView where I had not added "Layout = null" like this:
@{
Layout = null;
}
This is a Partial View
Not adding the "Layout = null" will result in the PartialView loading _Layout.cshtml, messing up everything.
Just thought I might add this, in case someone else encounters this problem.