I was hit by this bug too when installing Zentyal server 5.0 (based on Ubuntu Server 16.04 with Ubiquity) [1] on a Dell Poweredge R530 with a 4Tb Raid 5 hard disk.
If I chose guided partitioning, Ubiquity created 3 partitions, 1 Mb bios_boot partition, ~ 4 Tb root partition, and 16 Gb Swap partition.
With above partitioning and booting in BIOS mode, I got "Error: attempt to read or write outside of disk `hd0'.".
While reinstalling I added a 2Gb /boot partition before the root (/) partition, it worked and was able to boot into the installed system.
TL;DR: Grub failed on 4Tb / partition *in BIOS mode*, worked when a /boot partition was created.
I was hit by this bug too when installing Zentyal server 5.0 (based on Ubuntu Server 16.04 with Ubiquity) [1] on a Dell Poweredge R530 with a 4Tb Raid 5 hard disk.
If I chose guided partitioning, Ubiquity created 3 partitions, 1 Mb bios_boot partition, ~ 4 Tb root partition, and 16 Gb Swap partition.
With above partitioning and booting in BIOS mode, I got "Error: attempt to read or write outside of disk `hd0'.".
While reinstalling I added a 2Gb /boot partition before the root (/) partition, it worked and was able to boot into the installed system.
TL;DR: Grub failed on 4Tb / partition *in BIOS mode*, worked when a /boot partition was created.
[1]: https:/ /wiki.zentyal. org/wiki/ Installation_ Guide#Zentyal_ Installer