Partition Type: FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF appeared when tried to remove Linux(UBUNTU 18.04) from dual boot from Mac I earlier had dual-booted my MacBook Pro(2013), Catalina OS with Ubuntu 18.04 LTS. I wished to remove it, so I erased the unwanted partition in disk utility and restarted my mac, it did not show the macOS symbol in refind so I started in internet recovery mode. Afterwards, I

 

followed step by step till the step where I removed my third and second partitions.
Since my MacBook is working on Catalina OS and the guide was given according to the Sierra, I refrained from going further.
Please help me out since I'm not that terminal savvy.
Remove the second and the third partition:

gpt remove -i 3 /dev/disk0
gpt remove -i 2 /dev/disk0

Add the (former) second partiton with the proper size and partition type: 

gpt add -i 2 -b 409640 -s 461916744 -t apfs /dev/disk0

Check disk0 and the resulting synthesized APFS container scheme with diskutil:

diskutil list #get the deviceID of the APFS container scheme
diskutil verifyDisk disk0
diskutil verifyVolume diskX #diskX: deviceID of the APFS container scheme



Assuming you want to resize the APFS container to the full size of the disk (500 GB) you have to enter:

diskutil apfs resizeContainer disk0s2 0