RDS Postgres chicken-and-egg problem altering roles
Your RDS master user is not a superuser.

ALTER ROLE changes the attributes of a PostgreSQL role. [...]
Roles having CREATEROLE privilege can change any of these settings except SUPERUSER, REPLICATION, and BYPASSRLS...

Omit incompatible settings from your ALTER ROLE command.