UUID does not change after grub reinstall

I got inspiration from this.

Turns out the encrypted swap i made defaulted to luks2.

The following solution helped

# overwrite old cryptsetp
cryptsetup luksFormat --type=1 /dev/nvme0n1p3
# add same password as before etc.
#using gparted I made the underlying partition a linux-swap
# modify all the necessary files in /etc/* folder as per my previous comment in this thread
# mount the filesystem
cryptsetup luksOpen /dev/nvme0n1p2 cryptroot
mount /dev/mapper/cryptroot /mnt
# mount all volatile things as per usual chroot
mount /dev/nvme0n1p1 /mnt/boot/efi
cryptsetup luksAddKey /dev/nvme0n1p3 /mnt/crypto_keyfile.bin
cryptsetup luksOpen /dev/nvme0n1p3 cryptswap
chroot /mnt
swapon /dev/mapper/cryptswap
mkinitcpio -P
grub-install
update-grub