Windows – macOS no longer finding Windows Partition

bootcamppartitionwindows

While attempting to remove a Windows partition through Boot Camp Assistant, the process ended in an error. Now, upon going into Disk Utility, macOS is only showing my macOS partition of 400GB out of the maximum 500GB and the original 100GB Boot Camp partition is missing. Any way to resolve this and to recover the space to fully remove the Windows installation? The end goal being to use Parallels to reinstall Windows. Any help is greatly appreciated. Thank you.

Info:
macOS 10.13.3
MacBookPro 10,1 (Retina Mid 2012)

    diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         400.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +400.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            309.4 GB   disk1s1
   2:                APFS Volume Preboot                 19.7 MB    disk1s2
   3:                APFS Volume Recovery                509.8 MB   disk1s3
   4:                APFS Volume VM                      2.1 GB     disk1s4

/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +2.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Time Machine Backups    2.0 TB     disk2s2

diskutil apfs list

diskutil apfs list
APFS Container (1 found)
|
+-- Container disk1 F4485D24-ACD0-4DBF-A434-D8C941763B6C
    ====================================================
    APFS Container Reference:     disk1
    Capacity Ceiling (Size):      400068423680 B (400.1 GB)
    Capacity In Use By Volumes:   309839974400 B (309.8 GB) (77.4% used)
    Capacity Available:           90228449280 B (90.2 GB) (22.6% free)
    |
    +-< Physical Store disk0s2 8DC157B0-BAE2-4C3F-B025-6DC4DC81C1E9
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk0s2
    |   Size:                       400068423680 B (400.1 GB)
    |
    +-> Volume disk1s1 58B8E3C4-B274-3000-871A-A81E7DDCFD5C
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s1 (No specific role)
    |   Name:                      Macintosh HD (Case-insensitive)
    |   Mount Point:               /
    |   Capacity Consumed:         307010723840 B (307.0 GB)
    |   FileVault:                 No
    |
    +-> Volume disk1s2 2ED43133-C410-4C09-9A86-DF35400166C5
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s2 (Preboot)
    |   Name:                      Preboot (Case-insensitive)
    |   Mount Point:               Not Mounted
    |   Capacity Consumed:         19677184 B (19.7 MB)
    |   FileVault:                 No
    |
    +-> Volume disk1s3 E8F57C77-7C8D-492F-9C45-ECD8924AACF2
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s3 (Recovery)
    |   Name:                      Recovery (Case-insensitive)
    |   Mount Point:               Not Mounted
    |   Capacity Consumed:         509825024 B (509.8 MB)
    |   FileVault:                 No
    |
    +-> Volume disk1s4 EE50DC81-0666-4492-99D9-1393244B0DF0
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk1s4 (VM)
        Name:                      VM (Case-insensitive)
        Mount Point:               /private/var/vm
        Capacity Consumed:         2147504128 B (2.1 GB)
        FileVault:                 No

Best Answer

The command given below will add the free space back to the container. You need to enter the command in a Terminal application window.

sudo  diskutil  apfs  resizeContainer  disk0s2  0 

I thought this command could be entered while booted to High Sierra. Evidently, the OP needed to boot to recovery mode.