aws cli query multiple attributes when these attributes are on the same level

You sure can, you will have to use what JMESPath is describing in the examples as filters and multiselect hashes.

With this, you can recreate an object with queries going down the tree.

In your case, with the query:

NetworkInterfaces[*].{ InstanceId: Attachment.InstanceId, GroupNames: Groups[*].GroupName }

and the JSON data:

{
    "NetworkInterfaces": [
        {
            "Attachment": {
                "AttachTime": "2019-10-09T07:15:44+00:00",
                "AttachmentId": "eni-attach-01234567",
                "InstanceId": "i-12345678",
                "InstanceOwnerId": "123456789",
                "Status": "attached"
            },
            "AvailabilityZone": "us-east-1c",
            "Description": "Primary network interface",
            "Groups": [
                {
                    "GroupName": "sg-number1",
                    "GroupId": "sg-123456"
                },
                {
                    "GroupName": "sg-number_2",
                    "GroupId": "sg-654321"
                }
            ]
        }
    ]
}

It gives:

[
  {
    "InstanceId": "i-12345678",
    "GroupNames": [
      "sg-number1",
      "sg-number_2"
    ]
  }
]

So your commands ends up being:

aws ec2 describe-network-interfaces --filters Name=group-id,Values=sg-123456 --output json --query 'NetworkInterfaces[*].{ InstanceId: Attachment.InstanceId, GroupNames: Groups[*].GroupName }'