You need the magic term missing from those commands:
sudo nano /etc/gdm3/custom.conf
Then edit as per the lines explained. Once amended, press Ctrl+ O to write out the changes to the file, then Ctrl+ X to exit the editor.
Then reboot, choose your username and the cog will no longer appear. If at some stage you wanted to try a different Desktop Environment such as Cinnamon, Budgie, or KDE, the cog will appear again to give you the option to change to a different DE.