Having to set root and prefix every time I boot on grub 2 “minimal bash like editing”

I tried the alternative method shown here using boot-repair after the system didn’t detect at all the linux bootloader (only windows option and the disc only (which I don’t know why it appears) were in the bios boot order options and in the boot menu). Now the BIOS detects the bootloader (ubuntu is added to the list), but in this minimal bash mode.

I have to type the following lines to make it show the usual splash screen, just as I customised it:

set root=(hd0, gpt5) (this is my root partition)
set prefix=(hd0, gpt5)/boot/grub
insmod normal
normal

Why do I have to type this every time I boot? How can I solve it? I also tried to use boot-repair to reinstall grub completly ticking the purge grub option, but it still doesn’t work