Yeah, that is a problem...
One approach is to copy all the code of https://github.com/Orckestra/C1-CMS/blob/312d7c231657181f6bf8a1111bc64594591f0a53/Composite/Plugins/PageTemplates/Razor/RazorPageTemplateProvider.cs and https://github.com/Orckestra/C1-CMS/blob/312d7c231657181f6bf8a1111bc64594591f0a53/Composite/Plugins/PageTemplates/Razor/RazorPageRenderer.cs into your own classes, and replace the RazorPageTemplateProvider in composite.config with your new and modified version.
That way you can make sure to add the necessary items to the Context Container before executing TemplateDefinitionHelper.BindPlaceholders(...)
One approach is to copy all the code of https://github.com/Orckestra/C1-CMS/blob/312d7c231657181f6bf8a1111bc64594591f0a53/Composite/Plugins/PageTemplates/Razor/RazorPageTemplateProvider.cs and https://github.com/Orckestra/C1-CMS/blob/312d7c231657181f6bf8a1111bc64594591f0a53/Composite/Plugins/PageTemplates/Razor/RazorPageRenderer.cs into your own classes, and replace the RazorPageTemplateProvider in composite.config with your new and modified version.
That way you can make sure to add the necessary items to the Context Container before executing TemplateDefinitionHelper.BindPlaceholders(...)