With Ubuntu, GRUB files are stored in the EFI/BOOT and EFI/ubuntu folders in the hidden EFI partition. Apply the following steps to remove the GRUB files.
Enter the following command to determine the identifier for the hidden EFI partition on the external drive.
For this example, I will assume the identifier is disk2s1. In the following steps,...
Linux filesystem partitions may not not appear in the Disk Utility application. I would not recommend using the Disk Utility or diskutil command to remove Linux filesystem or swap partitions. Usually, attempting leads to an unbootable macOS.
I would recommend the following two ways to remove linux partitions.
If your Linux installer flash drive has a ...
Recreating the Problem
Before I provide an answer which explains how to install rEFInd to work properly on a Mac with a T2 chip, I will first incorrectly install rEFInd by following a path similar to the one taken by the OP. I do this because the OP posted a comment stating the following.
Unfortunately, I had No Security set way before I installed rEFInd so ...