In order to create a database, it needs to be able to connect to your database server in order to issue the "CREATE DATABASE" command. Connecting to the server requires you to specify an existing database to connect under, and obviously that cannot be the database which fails to exist and which is to be created. There are special databases usually reserved for maintenance operations, usually
postgres, which you can connect to for this purpose.
--dbname specifies not the name of the database to be restored into, but rather the name of the database to be used to create the other database.