Error ... pg_restore: creating ACL "pg_catalog.TABLE "pg_partitioned_table"" pg_restore: creating ACL "pg_catalog.TABLE "pg_pltemplate"" pg_restore: while PROCESSING TOC: pg_restore: from TOC entry 12691; 0 0 ACL TABLE "pg_pltemplate" postgres pg_restore: error: could not execute query: ERROR: relation "pg_catalog.pg_pltemplate" does not exist Command was: GRANT ALL ON TABLE "pg_catalog"."pg_pltemplate" TO "dhw_admin";
This is not a PostgreSQL issue. You have granted custom permissions to a catalog table. There is an attempt to transfer your grant, but in 13 there is no more pg_pltemplate catalog, thus the error.
You need to revoke this grant on the 12 database before performing pg_upgrade.