DROP database doesn't appear to drop all database objects
You can't drop the database you are currently connected to.  You are connected to some_db, not mydb.  You drop mydb, then create mydb agsin, but you don't change your connection from some_db to mydb. Creating a database does not automatically change your connection to the newly created database.  So the table you created is attempted to be created in some_db, where it evidently already exists.

You can't create objects in a database you are not connected to, so fully qualifying the object name will not help.  You can use the psql meta-command \c to change your connected database in the .sql script.  Of course you have to go through authentication again.