When this option is used, the database named with -d is used only to issue the initial DROP DATABASE and CREATE DATABASE commands. All data is restored into the database name that appears in the archive."
If you analyze the log above you can see that the database that is dropped is not the one used after the -d option but the one in the dump file.
So I think it is an error in the description of the option -C no ?
Or maybe I don't understand maybe the description but it also says above "If --clean is also specified, drop and recreate the target database before connecting to it."
It is clearly stated "target" here not the source database.
"used to issue" means that it is the database being connected to in order to execute SQL. Per the final sentence, the database name that appears in those SQL commands is the one in the source file. Which furthermore makes sense as you cannot drop a database to which you are connected.
If you don't want the name of the restored database to match the name of the source database you don't specify --create .
I can see an argument for -d mentioning the different usage of the database name when --create is specified. I can kinda see not requiring the mental leap that because the data is restored into the database named in the source that the cleaned and created database name must likewise be the one in the source. IOW, there is no bug here but I can appreciate that the existing wording could be a challenge to interpret. Now that you know how it works do you have a suggestion for improving the wording?