Can't boot to macOS anymore after resizizing macOS partition

Solution 1:

The type GUID for partition 2 of /dev/sda is wrong. The commands below will correct the problem. Enter the commands in an Ubuntu terminal window.

sudo gdisk /dev/sda
t
2
AF0A
w
y

Note: I realize the gdisk output shows hybrid partitioning. However, both macOS and Ubuntu should ignore the 2nd, 3rd and 4th entries in the MBR partition table.