That command will work, but after running it then it must be manually repeated with EVERY kernel update.
Several releases back fedora modified grub and made that file (/boot/efi/EFI/fedora/grub.cfg) a pointer file that redirects grub to the actual grub.cfg file located at /boot/grub2/grub.cfg. Normal updates no longer modify that file in any way so once one has modified it the automatic updates done with a kernel install do not touch it.
Recovery is fairly simple.
sudo rm /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
dnf reinstall grub2-common
(ordnf reinstall grub2-*
)
This should recreate both the files removed in step 1- reboot
Just so you are aware for future use the proper command to update grub.cfg is sudo grub2-mkconfig -o /boot/grub2/grub.cfg
or as was already mentioned sudo grub2-mkconfig -o /etc/grub2.cfg
.
Official documentation is here