Can't reboot mac os siera to factory settings
The reason you are having issues with this is because the guide incorrectly tells you to press Command + R which is Recovery Mode but uses your local drive and means you can't erase the whole drive.
You need to run Command + Option + R which will run Internet Recovery Mode, and from there you'll be able to show all the partitions and erase the top level one as APFS then quit Disk Utility and install macOS to this new empty drive.