Find in which group the package was installed

$ dnf repoquery --installed --qf='%{name}-%{evr}.%{arch} (%{reason})'
grub2-pc-1:2.06-109.fc39.x86_64 (group)

$ dnf repoquery --groupmember grub2-pc
grub2-pc-1:2.06-109.fc39.x86_64
  @anaconda-tools
  @cloud-bootloader-tools

When using repoquery grub2-pc is listed as group install, but I have neither group installed. (Default installation, and I tried recursively dnf group info on every installed group, but didn’t see the 2 groups.)
How to find the reason of the group mark?

EDIT:
Is grub stuff just manually marked as group without actually having a group, during install / image creation?
In F29 they were in --userinstalled, but no longer in later versions.

How did you install the system?

It’s a VPS that provided only Fedora 29 server image, the system is then upgraded to F39 with 5 upgrades.
Fedora 39 workstation on my PC is used as a reference for what the installed package list is supposed to be like. It’s installed using anaconda on live-usb (F39 fresh install) as usual. The command output is from the PC.

$ dnf repoquery --groupmember <package-spec>
# Gives group-id
$ dnf group info <group-spec>
# Shows group name

are the right commands, if none of the groups are installed, then there is no group.

Having a group mark means it will be handled as a group package, but doesn’t necessarily means a group is installed. E.g. say a user installed package is also included in a group called A, if the package is changed to group mark, then dnf group remove A will remove it.

The grub stuff is “userinstalled” when installing with Fedora Server or Everything (tried Workstation group) installer. It’s strange that the Live Workstation image has them marked as group.