Remove object from specific group programmatically
If you don't mind not using python, you can just select the objects and press &#9096; Ctrl&#9095; AltG, then select the group you want to remove them from:





If you still want to use python, then you want a group operator, rather than a object operator:

bpy.ops.group.objects_remove(group="myGroup")


This will remove the selected objects from the group "myGroup".