Just to add to the discussion, in SXA they only use getRenderingDatasource to create the Page data folder and adding the global and page data items to the DatasourceRoots object. SXA creates the datasource item automatically in the Add rendering command. You can find the code in the assembly Sitecore.XA.Foundation.Editing in the function Sitecore.XA.Foundation.Editing.Commands.AddRendering. <command name="webedit:addrendering" type="Sitecore.XA.Foundation.Editing.Commands.AddRendering, Sitecore.XA.Foundation.Editing" patch:source="Sitecore.XA.Foundation.Editing.config"/>