System fails to recognize main macos boot partition after Ubuntu dual booting attempt
From Ubuntu, you need to run the command gdisk. 


Open a Terminal. Basically, press the control+alt/option key combination.
Enter the command given below to execute gdisk.

sudo gdisk /dev/sda

If the version is not at least 1.0.4, then enter the q command to exit gdisk. Next, enter the commands given below to update gdisk, then return to step 2. Otherwise, proceed to step 4.

sudo apt-get update
sudo apt-get install gdisk

Enter the following when prompted by gdisk. This will change the type for the macOS partition to APFS.

t
2
af0a
w
y



References

GPT fdisk Tutorial
Man page of gdisk