postgresql, duplicate database which is a replication of another
It looks like you have a physical standby/replica. In physical standby, you cannot have a writeable copy of any database. If you want a writable copy of the database, you can follow either of the following:


Create a new cluster postgreSQL and export the database from a READ replica (physical standby) using pg_dump and pg_restore. (Refer the pg_dump/pg_restore command from PostgreSQL document)
You can use logical replication from the master
https://www.enterprisedb.com/postgres-tutorials/logical-replication-postgresql-explained