Mac EFI partition in wrong place (disk0s2 not disk0s1)

I posted this answer since the steps fulfill your requirement given below.

I do not want to delete both disk0s1 and disk0s2 and then create a new EFI partition in the right disk0s1 location, since I am afraid that deleting disk0s1 will result in problems.

Below are the steps needed to correct your problem.

  1. Boot the Mac to a version of macOS Recovery that is the same version or newer than the macOS you are using. You do not have to use internet recovery. The recovery that is already on your internal drive should work just as well.

  2. Open a Terminal window and enter the command below to confirm the ProductVersion shows the same version or newer than the macOS you are using.

    sw_vers
    
  3. Enter the command given below to add a new EFI partition as the third entry in the GPT.

    gpt -f add -i 3 -b 6 -s 76800 -t efi disk0
    

    Note: This will result in GPT entries that are no longer in ascending order. This will be fixed in a later step.

  4. Enter the command given below to format the new EFI partition.

    newfs_msdos -F 32 -v EFI /dev/rdisk0s3
    
  5. Restart back to macOS.

  6. Open a Terminal window and enter the command below. Confirm disk0s2 has a TYPE of EFI and a NAME of NO NAME.

    diskutil list
    
  7. Enter the command below to remove the original EFI partition. This command will also arrange the GPT entries in ascending order without changing the identifiers disk0s1 and disk0s3.

    diskutil erasevolume free none disk0s2
    
  8. Restart the Mac to reassign the identifiers in ascending order.


I neglected to include a step where any of the contents of the old EFI partition is copied to the new EFI partition. I doubt there is anything worth copying. However if you want to try, then after step 6, use the commands below to mount the two EFI volumes.

sudo diskutil mount disk0s2
sudo diskutil mount disk0s3

After you are finished copying, use the commands below to unmount the two EFI volumes.

diskutil unmount disk0s2
diskutil unmount diks0s3

Proceed to step 7.


Just for comparison here are the diskutil and gpt output for my very standard layout.

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         500.0 GB   disk0s2
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2          4         Pri GPT table
          6      76800      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      76806  122061321      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
  122138127          4         Sec GPT table
  122138131          1         Sec GPT header

There are few non-standard things in your disk.

  1. Your EFI should be in the 76800 size partition.
  2. The EFI partition should have a name.
  3. The EFI partition is smaller than mine.
  4. You have some free space - maybe the remnant of a non-macOS installation.

It might be possible to move the EFI partition, but I leave that to someone more knowledgeable.

My advice (what I would do):

  1. Backup everything using Time Machine (or your backup/recovery solution of choice). Double check that you have a good backup.
  2. Boot to Recovery mode.
  3. Erase the whole disk.
  4. Install macOS from the Internet.
  5. Recover your apps, settings and data from backup using Migration Assistant.

Then you would have the standard disk layout.