The same thing happens if you use diskutil the wrong way. If you use Disk Utility to erase an APFS volume and format it HFS+, you’ll find that the old APFS container sticks around. A diskutil list, showing the APFS Container scheme. Below that, /dev/disk3 is the APFS container, and /dev/disk3s1 is the APFS volume. You can see disk2s2 in the screenshot below, the partition on my external hard drive hosting the APFS Container. In the Terminal, running diskutil list will reveal this in even starker contrast.