Dual boot Ubuntu - macOS Issue

Solution 1:

When the diskutil command or the Disk Utility application is applied to a drive which has Linux type partitions, the partition type GUID stored in the GUID Partition Table (GPT) for a macOS partition is often changed to FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF. The GParted image you posted in your question will not show this change. In other words, if the partition type GUID for /dev/sda2 had been changed from 7C3457EF-0000-11AA-AA11-00306543ECAC to FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF, then the file system shown in GParted will still remain apfs. This is because GParted looks at the content of the partition to determine the filesystem and not at the partition type GUID. However, the Mac firmware (Mac Startup Manager) does look at the partition type GUID when displaying possible operating systems to boot from.

One possible way to determine, if the partition type GUID for /dev/sda2 is 7C3457EF-0000-11AA-AA11-00306543ECAC, is to view the output from the command shown below. This command needs to be entered in an Ubuntu Terminal application window. (From the Ubuntu desktop, press the key combination option+control+T to open a Terminal application window.)

sudo gdisk -l /dev/sda

You should see the code AF0A. If you see code FFFF then partition type GUID is probably FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF. If necessary, you can change the partition type GUID back to 7C3457EF-0000-11AA-AA11-00306543ECAC by entering the command and interactive input shown below. Here I assume number for this partition is 2. If not, then make the appropriate substitution below.

sudo gdisk /dev/sda
t
2
AF0A
w
y

Note: The gdisk command uses 4 character codes to represent the much longer partition type GUIDs.

A Clarification Regarding the Question

In your question you state "GRUB has replaced the Mac's boot loader". Actually, this is impossible. The Mac boot loader is implemented in firmware. In your case, the Macs boot loader is boot loading GRUB and then GRUB is boot loading Ubuntu.