In the Synopsis section of https://www.postgresql.org/docs/current/sql-alterdomain.html this is incorrect (incomplete): "ALTER DOMAIN name ADD domain_constraint [ NOT VALID ]" It should be "ALTER DOMAIN name ADD CONSTRAINT domain_constraint [ NOT VALID ]"
The definition of “domain_constraint” includes the optional “constraint constraint_name” clause. Though reading the page and seeing the number of times we say “alter domain add constraint” I even more inclined to agree that bringing the word constraint there is desirable. I am not a huge fan of the indirect syntax references anyway. But I think your proposed fix is technically wrong since the word constraint is optional but your change makes it mandatory.