Suppose the current shape id is 58. If a group is created it will get the id 58 and the first shape created within it will get id 59. However, if a new shape is created outside the group it will also get id 59 (as the next id available at the slide level). Any future use of the id risks getting the wrong shape.
Thanks for bringing this up. Fixed via r1831947