The method themeDisplay.getParentGroupId() and other similar methods were created when layout scope groups were created. This method always returns the groupId of the current site regardless of whether the data to be displayed is from a more specific layout scope. The reason for the name parentGroup is because the site group is a parent of the scope groups. But now that Liferay supports a hierarchy of sites, the name of this method is confusing.
For this reason we are renaming it to themeDisplay.getSiteGroupId() which clearly reflects the result of the method.