The OS_prober feature is disabled by default in GRUB 2.06, which is the version included in Ubuntu 22.04. This is an upstream change designed to counter potential security issues with the OS-detecting feature (it mounts partitions to check for other OSes, this could be taken advantage of, etc).
That's why. You need to enable the os_prober in your grub settings manually or put your windows line in /etc/default/grub or so.