This page data context initializer is new for Kentico Xperience 13, but it kind of replaces Kentico 12's way of initializing the page builder context:
HttpContext.Kentico().PageBuilder().Initialize(page.DocumentID);
If you are using content-tree based routing, page data context initialization is handled for you automatically by the system. But if you're using custom routing (which I guess you might be for your error controller) then you need to initialize the page data content manually.