The current code of splitting DAG does not handle cases where there is split and a clean segmentation is not possible. It also does not handle cases where there is multiple segments and they are later used together. Both cases it ends up with "Invalid dag containing 0 vertices" error as it creates one empty DAG and and a new DAG which contains the full original plan as it was not able to segment.
Usually can ask user to get rid of unnecessary store and then load if in same script as it is usually a result of bad programming and inefficient. But in this case they were part of different large scripts and run as below.