This is what I get -- I can pass in three different groups, all of which I created, and it will add one of them. Nothing matters, I pass individual IDs or I pass a list of IDs or I pass a list of group objects (as seen here) -- always the same -- it will share with some groups but not others. There has to be some magic "don't share with this one" flag that I can't see. Here's a snippet from a jupyter notebook.
service_id = "e5b7345b622040f096fa923a807f55d0"
group_manager = gis.groups
gg = group_manager.search(query='GIS Team')[0]
print("group id", gg.id)
gc = group_manager.search(query='Cartographers')[0]
print("group id", gc.id)
ge = group_manager.search(query='Emergency Management')[0]
print("group id", ge.id)
content_manager = gis.content
service = content_manager.get(service_id)
print("service", service)
#rval = gis.content.share_items([service_id], groups=['Cartographers'])
rval = service.share(groups=[gg,gc,ge])
print("rval =", rval)
print('shared with', service.shared_with)
Here is the output. Everything "succeeds" it always returns "success=True" and "notSharedWith" some of the inputs.
group id 53378c27d6b34383bc4fc2aa87fc630d
group id 8b6bd8ec1a4142f988119e6290af51d7
group id 0682bb6881ab41b691bedafd2f2740b2
service <Item title:"Surveys_MIL" type:Map Image Layer owner:bwilson@CLATSOP>
rval = {'results': [{'itemId': 'e5b7345b622040f096fa923a807f55d0', 'success': True, 'notSharedWith': ['', '53378c27d6b34383bc4fc2aa87fc630d', '8b6bd8ec1a4142f988119e6290af51d7']}]}
shared with {'everyone': False, 'org': False, 'groups': [<Group title:"Emergency Management" owner:bwilson@CLATSOP>]}