Hi, @Andrei Haba Welcome to Microsoft Q&A thanks for posting your question.
It looks like you are specifying the wrong file path for the backup file. based on the documentation i tried below commends and was able to restore successfully.
https://learn.microsoft.com/en-us/azure/postgresql/migrate/how-to-migrate-using-dump-and-restore
Can you try as below?
pg_dump -Fc -v --host=postgrestest.postgres.database.azure.com --username=yourusername --dbname=testdb -f mytest.dump
pg_restore -v --no-owner --host=postgrestest2.postgres.database.azure.com --port=5432 --username=yourusername2 --dbname=test2db mytest.dump
Regards
Geetha